PDA

View Full Version : Windows & UpdatePanel



issameddine
Mar 19, 2008, 8:15 AM
HI,
I'm a .Net developper & i use coolite toolkit.
my problem is:
I would develop an authentification page. i have a button, when i click, i show a coolite window to write login & password. i would like, after verification close the window.


<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager2" runat="server"> </asp:ScriptManager>
<cool:ScriptManager ID="ScriptManager1" runat="server" />
<cool:Panel ID="Panel1" runat="server" Header="False" HeaderAsText="False" Height="81px"
BodyBorder="False" >
<Content>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<div runat="server" id="divmenu" visible="false" style="background-image: url(../../img/blue.jpg)">
<asp:Table ID="_TbMenu" runat="server" Width="100%" Height="100%">
<asp:TableRow ID="TableRow4" runat="server">
<asp:TableCell ID="TableCell9" runat="server" Width="80%"></asp:TableCell>
<asp:TableCell ID="TableCell1" runat="server" Width="2%">
<asp:Image ID="Image1" runat="server" ImageUrl="../../img/expand.gif" />
</asp:TableCell>
<asp:TableCell ID="TableCell8" runat="server" Width="18%">
<asp:LinkButton ID="LinkButton2" CssClass="lbLibelle" runat="server">Administration</asp:LinkButton>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow2" runat="server">
<asp:TableCell ID="TableCell2" runat="server" Width="80%"></asp:TableCell>
<asp:TableCell ID="TableCell3" runat="server" Width="2%">
<asp:Image ID="Image2" runat="server" ImageUrl="../../img/expand.gif" />
</asp:TableCell>
<asp:TableCell ID="TableCell6" runat="server" Width="18%">
<asp:LinkButton ID="LinkButton3" CssClass="lbLibelle" runat="server" EnableTheming="false">Accéder à WebIntéressement</asp:LinkButton>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow3" runat="server">
<asp:TableCell ID="TableCell4" runat="server" Width="80%"></asp:TableCell>
<asp:TableCell ID="TableCell5" runat="server" Width="2%"></asp:TableCell>
<asp:TableCell ID="TableCell7" runat="server" Width="18%"></asp:TableCell>
</asp:TableRow>
</asp:Table>


</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="_Btconnecter" EventName="click" />
</Triggers>
</asp:UpdatePanel>
</Content>
</cool:Panel>
<cool:Panel ID="Panel2" runat="server" ButtonAlign="Left" Header="False" BodyBorder="False" Height="500">
<Content>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Table ID="Table1" runat="server" Width="100%" Style="background: #c3daf9 url(../../img/tb-blue.gif) repeat-x 0 -16px;">
<asp:TableRow ID="TableRow1" Width="100%" runat="server">
<asp:TableCell runat="server" ID="v" Width="90%" />
<asp:TableCell ID="BtConnecter" runat="server" Width="10%">
<asp:LinkButton ID="LinkButton1" CssClass="lbLibelle" runat="server">Se connecter</asp:LinkButton>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="_Btconnecter" EventName="click" />
</Triggers>
</asp:UpdatePanel>

&amp;nbsp; &amp;nbsp;
</Content>
</cool:Panel>
&amp;nbsp;<br />

<br />
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<cc2:PasswordStrength ID="PasswordStrength1" runat="server" TargetControlID="_TbPassword">
</cc2:PasswordStrength>
<cool:Window ID="Window1" runat="server" TriggerElement="LinkButton1" IconCls="Auth"
AnimateTarget="LinkButton1" AutoShow="false" Collapsible="true" Height="164px"
Width="250px" HideParent="True" Modal="True" CloseAction="Hide" Title="Authentification">
<Content>
<table width="236" style="height: 134px" border="0" align="center" cellpadding="0"
cellspacing="0" id="Tableau_01">
<tr>
<td style="width: 236px">
<table border="0" align="center" cellpadding="0" cellspacing="0" style="width: 206px;
height: 50px">
<tr>
<td style="width: 86px">
&amp;nbsp;&amp;nbsp;Login:&amp;nbsp;</td>
<td style="width: 113px">

<asp:TextBox ID="_TbLogin" runat="server" CssClass="Style8" Columns="15" TabIndex="1"
Width="120px">test</asp:TextBox><asp:RequiredFieldValidator ID="_RFLogin" runat="server"
ControlToValidate="_TbLogin">*</asp:RequiredFieldValidator>

</td>
</tr>
<tr>
<td height="28" style="width: 86px">
&amp;nbsp;&amp;nbsp;Mot de passe:</td>
<td style="width: 113px">

<asp:TextBox ID="_TbPassword" CssClass="Style8" runat="server" Columns="15" TabIndex="2"
TextMode="Password" Width="120px">user</asp:TextBox><asp:RequiredFieldValidator ID="_RFPassword"
runat="server" ControlToValidate="_TbPassword">*</asp:RequiredFieldValidator>

</td>
</tr>
<tr>
<td style="width: 86px">
</td>
<td style="width: 113px" class="tdAlignRightEntete">
<asp:Button ID="_Btconnecter" CssClass="btEntete" runat="server" Text="Connecter"
&#111;nclick="_ImBtConnecter_Click" />
</td>
</tr>
</table>
<div align="center">


</td>
</tr>
</table>
</Content>
</cool:Window>
</ContentTemplate>
</asp:UpdatePanel>


</form>

geoffrey.mcgill
Mar 20, 2008, 3:40 PM
You should be able to set the AutoShow property to "true" when you want to Show the Window, and then set the AutoShow to "false" when you want to close. Does this work with your UpdatePanel configuration?

There is also a .Close Method on window.

Example


this.Window1.Close()


Hope this helps.

ljcorreia
May 28, 2008, 8:12 AM
Hi

I have a very similar scenario here with a login page.
My Login Page is using standar asp:Login with Forms Authentication:



<html>
<head id="Head1" runat="server">
<title>login page</title>
<meta http-equiv="Pragma" content="no-cache" />
</head>
<body>

<form id="form1" runat="server" >
<table width="100%" style="height:100%">
<tr>
<td align="center" valign="top">
<asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate" CreateUserText="Create New User"
CreateUserUrl="~/CreateAccount.aspx" PasswordRecoveryText="Forgot Password?"
PasswordRecoveryUrl="~/ForgotPassword.aspx">
</asp:Login>
</td>
</tr>
</table>
</form>
</body>
</html>


Following the AutoLoad Example, the code above is the page that will be opened from my parent page using AutoLoad.

The problem is the cool:Window is on my parent page and the user validation is done on server side of my login page above.
I need to destroy my window only if the user is correctly authenticated.

I tried to put &#111;nsubmit="parent.location.reload();" and it works on IE (not for FF), but it will always force close the window, even when the user informed a wrong passord.

Cool window seems to be a simple div when I inspect using Firebug, but it opens a page as it was in a frame.
I don't know how it works. Maybe someone with more knownledge than me can help me in this scenario.

Someone can give me some tips, please?

Thanks.
Leonardo.

ljcorreia
May 28, 2008, 1:19 PM
Dear Coolite team,

Ok. I figured out how to solve the problem.
Thanks for your attention anyway.

Leonardo.

ljcorreia
May 28, 2008, 1:34 PM
Hey guys,

Sorry to bother you again, but I still may need your help in this scenario.
I thought the problem had gone, but still happens sometimes.

Sometimes, just in IE I am getting the message:

---------------------------
Error
---------------------------
A Runtime Error has occurred.
Do you wish to Debug?


Line: 161
Error: 'Ext.EventObject' is null or not an object
---------------------------
Yes No
---------------------------

For some reason I believe that it may be related to the garbage collection routine and that's why it does not happen all the times.

I search for this error, but I could not get any info that helped.

Any clue?

Thanks.

Leonardo.