Click here to Skip to main content
12,399,625 members (52,797 online)
Rate this:
Please Sign up or sign in to vote.
See more: jQuery
Am working with jquerey getting the error

Microsoft JScript runtime error: Object doesn't support this property or method

when I remove jquerey Ui reference it's showing error like object expected

I have tried all the ways through google but it's not working

I am trying to show a popup dialog Calling Showmessage function from code behind using Page.ClientScript.RegisterStartupScript

my code follows here :

code behind :

Page.ClientScript.RegisterStartupScript(Me.GetType(), "MyScript", _
                   "javascript:showMessage();", True)

<link rel="shortcut icon" href="images/favicon.ico" />
    <link rel="icon" type="image/gif" href="images/tnt_icon.gif" /> 
    <link href="css/CommonStyles.css" rel="stylesheet" type="text/css" />  
    <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
	<script src="js/jquery-1.7.2.min.js" type="text/javascript" ></script>

any help would be appreciated

Thanks in advance
Pradeep Anugu
Posted 21-Mar-13 3:16am
@AmitGajjar 21-Mar-13 9:21am
Where you have write code to register javascript ? is that on page load or page init ?
Pradeepp Anugu 21-Mar-13 9:27am

not in page load in button click event
@AmitGajjar 21-Mar-13 9:29am
try to place javascript after all your code. this can be because javascript call before object creation.
Pradeepp Anugu 21-Mar-13 9:32am

thanks for ur reply

Protected Sub BoomerangLoginForm_LoginError(ByVal sender As Object, ByVal e As System.EventArgs) Handles BoomerangLoginForm.LoginError
If Not String.IsNullOrEmpty(BoomerangLoginForm.UserName.Trim()) Then
Dim oWebUser As MembershipUser = Membership.GetUser(BoomerangLoginForm.UserName.Trim())
If oWebUser IsNot Nothing Then
'if user exist
If Membership.GetUser(DirectCast(BoomerangLoginForm.FindControl("UserName"), TextBox).Text.Trim()).IsLockedOut Then
BoomerangLoginForm.FailureText = ""
Dim _alertString As String = "Sorry! Your attempt to log in is automatically denied as you have thrice entered an incorrect passowrd. Please click " & _
"" & _
"Forgotten your password
" & _
" to request a new password to enable you to access the secured pages of the website."
lblMessage.Text = _alertString
Page.ClientScript.RegisterStartupScript(Me.GetType(), "MyScript", _
"javascript:showMessage();", True)

------- > this is from where am calling java script function 'ScriptManager.RegisterClientScriptBlock(Page, Me.GetType(), "MyScript", _
' "javascript:showMessage();", True)

BoomerangLoginForm.FailureText = "Invalid login id or password."
End If
'if user does not exist
'LoginForm.FailureText = "Login ID does not exist."
BoomerangLoginForm.FailureText = "Invalid login id or password."
End If
End If

End Sub
@AmitGajjar 21-Mar-13 9:34am
ok, but try to place your script tag and script files after your aspx page completed. and check the result.
Shubhashish_Mandal 21-Mar-13 9:23am
Try to run it in firefox and grab the proper error message from error console.
Pradeepp Anugu 21-Mar-13 9:29am
currently I am using IE 8.....
Sergey Alexandrovich Kryukov 21-Mar-13 11:24am
Bad reply! Use firefox. Or use JavaScript debugger.

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.160721.1 | Last Updated 21 Mar 2013
Copyright © CodeProject, 1999-2016
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