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

Thread: Show a ModalPopUpExtender from JavaScript

  1. #1
    Join Date
    Apr 2005
    Posts
    172

    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
    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
           {
           
           }
           else
           {
             alert("The Specified User Name or Password are invalid");
             
             //Below is what I've tried so far and is not working.
            //$find("OrderDetailClient").show();
            // $object('ModalPopupExtender1')._show();
            //$object('ModalPopupExtender1').show();
                $object('ModalPopupExtender')._show();             
                Sys.Application.load.add(showPanel);            
        
           }
        }
    
    <div id="PanelInfo">
       <asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup" >
         <table>
           <tr>
             <td><asp:Label runat="server" ID="lblUserName" Text="User Name:"/></td>
             <td><asp:TextBox runat="server" ID="txtUserName" /></td>
           </tr> 
           <tr>
             <td><asp:Label runat="server" ID="lblPassword" Text="Password:"/></td>
             <td><asp:TextBox runat="server"  ID="txtPassword" TextMode="Password" /></td>
           </tr>
           <tr>     
             <td>
                 <input id="OKButton" type="button" value="OK" onclick="test()" style="width: 53px"  /></td>
             <td></td>
           </tr>
        </table>       
      </asp:Panel>
    
    
    
    <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
                TargetControlID="Button1"
                PopupControlID="Panel1" 
                BackgroundCssClass="modalBackground" 
                OkControlID="OkButton"
                DropShadow="true"
                PopupDragHandleControlID="Panel3" BehaviorID="OrderDetailClient" />

    Thanks very much in advance

    Susan

  2. #2
    Join Date
    Mar 2007
    Posts
    13

    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
    Posts
    10,871

    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 CodeGuru survey question.


Featured


HTML5 Development Center