By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,922 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,922 IT Pros & Developers. It's quick & easy.

Microsoft JScript runtime error: Object expected

P: 24
function Showdiv()
var SelectStates = document.getElementById('Select1').value;
if(SelectStates ="3")
document.getElementById("div2").style.display = "block";

document.getElementById("div2").style.display = "none";
function GoToPage()
var SelectStates = document.getElementbyId('Select1').Value;'LotteryResultPage.aspx?country='+Sele ctStates+);
I have above js function and i am calling those function like below in the ascx control.

<select id="Select1" onchange="Showdiv()">

<asp:Button runat="server" ID="Button1" Text="Go" OnClientClick="GoToPage()" />

but when i run this it gives error 'Microsoft JScript runtime error: Object expected' , can anybone tell me why?
Jan 21 '08 #1
Share this Question
Share on Google+
1 Reply

Expert 5K+
P: 7,872
if that code is cut and paste then the problem is this:'LotteryResultPage.aspx?country='+Sele ctStates+);

You have an extra + at the end of your string
Jan 21 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.