Click here to Skip to main content
Rate this: bad
good
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>
	<script src="js/jquery-ui-1.8.21.custom.min.js" type="text/javascript" ></script>	
	<script src="js/jquery.uniform.js" type="text/javascript" ></script>	--%>
 
    <script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript" ></script>	
 
	<script type="text/javascript">
	
	     var jq = $.noConflict(true);
 
------> error here	    function showMessage()
        {
            jq('#Popup').dialog(
                {              
                    title: "Login | Failure",
                    position:['center',150],
                    modal: true,
                    resizable: false,
                    width: 650,
                    buttons: [
                    {
                        id: "button-ok",
                        text: "Ok",
                        click: function() 
                        { 
                            $(this).dialog("close");                         
                        }
                    }
                ] 
            });
            jq("#Popup").dialog("option", "buttons", null);
            //$('#Popup').parent().appendTo($("form:first"));
        }
    
        function closeDialog()
        {
             jq('#Popup').dialog('close');          
        }
   
	</script>
	
	<script type="text/javascript">
	<!--
	    function showThankYouMessage()
        {
            $('#PopupThankYou').dialog(
                {              
                    title: "Boomerange | Thank You",
                    position:['center',150],
                    modal: true,
                    resizable: false,
                    width: 600,
                    buttons: [
                    {
                        id: "button-ok",
                        text: "Ok",
                        click: function() 
                        { 
                            $(this).dialog("close");                         
                        }
                    }
                ] 
            });
            $("#PopupThankYou").dialog("option", "buttons", null);             
        }
    
        function closePopupThankYou()
        {
             $('#PopupThankYou').dialog('close');          
        }
    -->
	</script>
 
any help would be appreciated
 
Thanks in advance
Pradeep Anugu
Posted 21-Mar-13 4:16am
Comments
@AmitGajjar at 21-Mar-13 9:21am
   
Where you have write code to register javascript ? is that on page load or page init ?
Pradeepp Anugu at 21-Mar-13 9:27am
   

not in page load in button click event
@AmitGajjar at 21-Mar-13 9:29am
   
try to place javascript after all your code. this can be because javascript call before object creation.
Pradeepp Anugu at 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)
 

Else
BoomerangLoginForm.FailureText = "Invalid login id or password."
End If
Else
'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 at 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 at 21-Mar-13 9:23am
   
Try to run it in firefox and grab the proper error message from error console.
Pradeepp Anugu at 21-Mar-13 9:29am
   
currently I am using IE 8.....
Sergey Alexandrovich Kryukov at 21-Mar-13 11:24am
   
Bad reply! Use firefox. Or use JavaScript debugger.
—SA

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

  Print Answers RSS
0 OriginalGriff 459
1 Maciej Los 325
2 Sergey Alexandrovich Kryukov 234
3 DamithSL 233
4 BillWoodruff 200
0 OriginalGriff 7,168
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,461
3 Manas Bhardwaj 4,876
4 Maciej Los 4,450


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 21 Mar 2013
Copyright © CodeProject, 1999-2014
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