Show a ModalPopUpExtender from JavaScript
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: Show a ModalPopUpExtender from JavaScript

Hybrid View

  1. #1
    Join Date
    Apr 2005

    Show a ModalPopUpExtender from JavaScript

    Hey Everyone,

    I have a ModalPopUpextender which shows up when teh page loads and I am usig it for the user to enter a username and password.

    If the pasword is incorrect however, once the user clicks on the OK button I want the ModalPopUpExtender to NOT go away.
    I tried many different things.
    How can I make the dialog box Show when I wanted it from Java Script.

    here is my code
     function test()
           var password = document.getElementById('ctl00_ContentPlaceHolder1_txtPassword').value;
           var username = document.getElementById('ctl00_ContentPlaceHolder1_txtUserName').value;
           var response = _Default.Connect(username,password);
           if(response.value==1) //successful response
             alert("The Specified User Name or Password are invalid");
             //Below is what I've tried so far and is not working.
            // $object('ModalPopupExtender1')._show();
    <div id="PanelInfo">
       <asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup" >
             <td><asp:Label runat="server" ID="lblUserName" Text="User Name:"/></td>
             <td><asp:TextBox runat="server" ID="txtUserName" /></td>
             <td><asp:Label runat="server" ID="lblPassword" Text="Password:"/></td>
             <td><asp:TextBox runat="server"  ID="txtPassword" TextMode="Password" /></td>
                 <input id="OKButton" type="button" value="OK" onclick="test()" style="width: 53px"  /></td>
    <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
                PopupDragHandleControlID="Panel3" BehaviorID="OrderDetailClient" />

    Thanks very much in advance


  2. #2
    Join Date
    Mar 2007

    Re: Show a ModalPopUpExtender from JavaScript

    Hi, Suzi!!!

    What is the _Default, Sys objects, and $find, $object functions, Where are the declarations???

  3. #3
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002

    Re: Show a ModalPopUpExtender from JavaScript

    It looks to me that you have set up the ModalPopup incorrectly. Take a look here for a clearer look.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a survey!

HTML5 Development Center