-
March 29th, 2007, 09:05 PM
#1
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
-
March 30th, 2007, 09:26 AM
#2
Re: Show a ModalPopUpExtender from JavaScript
Hi, Suzi!!!
What is the _Default, Sys objects, and $find, $object functions, Where are the declarations???
-
March 30th, 2007, 01:01 PM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|