Click here to Skip to main content
11,646,939 members (79,637 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Javascript
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 15-Mar-13 0:33am
Edited 15-Mar-13 0:52am
v2
Comments
Bojjaiah at 15-Mar-13 6:34am
   
can you post your code?
then only we know where you wrong!
Lakshmimsridhar at 15-Mar-13 6:53am
   
i posted my code please do check.
PJ003 at 19-Mar-13 8:58am
   
Post your Javascript code, for better understanding....
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Lakshmimsridhar at 15-Mar-13 6:50am
   
i am running in internet explorer itself
Mickt1985 at 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 at 15-Mar-13 6:59am
   
for what that link u given??
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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 errorSmile | :)
  Permalink  

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

  Print Answers RSS
0 jyo.net 510
1 Sergey Alexandrovich Kryukov 433
2 OriginalGriff 388
3 CPallini 334
4 F-ES Sitecore 309
0 OriginalGriff 1,253
1 jyo.net 994
2 DamithSL 896
3 Sergey Alexandrovich Kryukov 833
4 CPallini 720


Advertise | Privacy | Mobile
Web03 | 2.8.150731.1 | Last Updated 19 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100