Click here to Skip to main content
11,935,053 members (57,634 online)
Rate this:
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"

<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"

 <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.STATUS = 0;
c.CREATEDDATE = System.DateTime.Now.Date;


Posted 15-Mar-13 1:33am
Edited 15-Mar-13 1:52am
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....
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hey Please see[^]

If you use firefox you can debug you JScript and find out what the problem is.
Lakshmimsridhar 15-Mar-13 6:50am
i am running in internet explorer itself
Mickt1985 15-Mar-13 6:56am
Hey there is a different one I use for Internet Explorer, will tell you exactly what the error is
Lakshmimsridhar 15-Mar-13 6:59am
for what that link u given??
Rate this: bad
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 | :)

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.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