Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am getting error in follwoing code.



error is Microsoft JScript runtime error: Object expected

whenever i click button event this error use to come and it points to above code line.Please help me.


source code



 <uc1:HeaderWithmenu ID="HeaderWithmenu1" runat="server" />
Create Community

<asp:Label ID="Label1" runat="server" CssClass="label" Height="20px" Text="Requested Community Name"
Width="235px">
<asp:TextBox ID="txtCommunityname" runat="server"> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCommunityname"
ErrorMessage="Enter Community Name" Height="10px" Width="157px">
<asp:Label ID="lblmsg" runat="server" Style="position: relative" Width="95px"> <asp:Button ID="btncheck" runat="server" CssClass="regButton" Text="Check Availability"
Width="157px" OnClick="Button1_Click1" />
<asp:Panel ID="pnlCommunitycrate" runat="server" Height="50px" Width="125px">

<asp:Label ID="Label2" runat="server" Height="23px" Text="Community Purpose" Width="155px"> <asp:TextBox ID="txtCmtyPurpose" runat="server" Height="69px" TextMode="MultiLine"
Width="313px">
 <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtCmtyPurpose"
ErrorMessage="Enter Community Purpose" Height="34px" Width="166px">
      
<asp:Button ID="btnSubmitAdmin" runat="server" CssClass="regButton" Text="Submit to Admin"
Width="231px" OnClick="btnSubmitAdmin_Click" />



  


code behind

protected void btnSubmitAdmin_Click(object sender, EventArgs e)
{
Community c = new Community();
c.COMMUNITYNAME = txtCommunityname.Text.ToUpper();
c.USERNAME = uname;
c.COMMUNITYMESSAGE = "";
c.PURPOSE=txtCmtyPurpose.Text.ToString();
c.STATUS = 0;
c.CREATEDDATE = System.DateTime.Now.Date;

c.CreateCommunity(c.COMMUNITYNAME);

}
Posted
Updated 15-Mar-13 0:52am
v2
Comments
Bojjaiah 15-Mar-13 6:34am    
can you post your code?
then only we know where you wrong!
Lakshmimsridhar 15-Mar-13 6:53am    
i posted my code please do check.
PJ003 19-Mar-13 8:58am    
Post your Javascript code, for better understanding....

Hey Please see https://addons.mozilla.org/en-US/firefox/addon/firebug/[^]

If you use firefox you can debug you JScript and find out what the problem is.
 
Share this answer
 
Comments
Lakshmimsridhar 15-Mar-13 6:50am    
i am running in internet explorer itself
frostcox 15-Mar-13 6:56am    
Hey there is a different one I use for Internet Explorer, will tell you exactly what the error is http://www.fiddler2.com/fiddler2/
Lakshmimsridhar 15-Mar-13 6:59am    
for what that link u given??
Go to run and type inetcpl.cpl it gives internet properties in that click Advanced tab then there remove right mark(uncheck) the disable script debugging(internet explorer). so it wont give above error:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900