Sponsors

News

Jobping Laurent Kempé MVP JetBrains Academy Member Certified ScrumMaster

Contact

My status

View Laurent Kempé's profile on LinkedIn
XING
twitter
facebook


Xbox 360



Map

Locations of visitors to this page

.NET Dudes

Family

French .NET Dudes

Friends

Jobping

Links

Tech Head Brothers

Trip in the Atlas - Part 2

This time the targeted scenario was to implement a login the way I saw it on on10.net.

Using the Atlas Control Toolkit, I started to implement the scenario with a ModalPopup atlas control surrounding an ASP.NET Login.

After some drag and drop on the designer I hit the F5, and I was in front of my Modal login. Nice, but no postback, so no login. Tehn I came with the idea to add the property UseSubmitBehavoir to false for OK/Cancel button like so:

<asp:Button ID="OkButton" runat="server" Text="OK" OnClick="OkButton_Click" UseSubmitBehavior=false></asp:Button>

I had then my postback, but all controls in my login template were empty. After spending some time on that without success I gave up.

But yesterday evening I came back to this and downloaded the latest bits of the Atlas Control Toolkit from CodePlex. By the way Korby, I can't wait getting my projects there ;-) And restarted the implementation using the demo web application they deliver with it. And there it worked fine.

<asp:Panel ID="LoginPanel" runat="server" CssClass="modalPopup" Style="display: none">
   
<asp:Login ID="Login1" runat="server" LoginButtonText="S'identifier" PasswordLabelText="Mot de passe:" PasswordRequiredErrorMessage="Le mot de passe est requis." RememberMeText="Se souvenir de moi." TitleText="Identifiez vous " UserNameLabelText="Nom d'utilisateur:" UserNameRequiredErrorMessage="Le nom d'utilisateur est requis.">
   
</asp:Login>
   
<asp:Button ID="CancelButton" runat="server" Text="Cancel"></asp:Button></asp:Panel>

   <span class="login">

      <asp:LinkButton ID="LinkButton1" runat="server" Text="S'identifier"></asp:LinkButton>   |
      
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Register.aspx">S'enregistrer</asp:HyperLink>
   </
span>

<atlasToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server">
   <atlasToolkit:ModalPopupProperties TargetControlID="LinkButton1" PopupControlID="LoginPanel" BackgroundCssClass="modalBackground" CancelControlID="CancelButton" />
</
atlasToolkit:ModalPopupExtender>

And now with some slight modification to my implementation it is also working fine as you can see:

atlas login

Comments

Mikael Ohlsson said:

YES finally! UseSubmitBehavior=false you are my saviour!
# November 6, 2006 12:09 PM

GM said:

what is the alternative of this property in VS.Net 2003? I never faced this problem earlier.
# June 11, 2007 4:12 AM

Saul said:

How can you keep the modal popup when the username or password are incorrect?

# August 30, 2007 5:37 PM

lkempe said:

Saul: I don't use anymore the control asp:login (not the case on this post).

I made my own control out of the CSS Adapter rendering with the same look & feel of asp:login and I do that in javascript:

   onLoginComplete: function(validCredentials, userContext, methodName) {

       if (validCredentials == true) {

           this.hideLogin();

---

   hideLogin: function() {

       $removeHandler( document.body, 'keydown', this.eventKeyDown );

       var modalLogin = $find('ModalLogin');

       modalLogin.hide();                

   },

# August 30, 2007 7:17 PM

max said:

Hi, this is the code I'm using.

It keep the modal popup open when the login failed..

I hope you like it!

<asp:Panel ID="Panel1" runat="server" CssClass="hide">

<asp:LoginView ID="LoginView1" runat="server" >

<AnonymousTemplate>

<asp:LoginStatus ID="LoginStatus2" runat="server" />

<asp:Panel ID="Panel2" runat="server">

 <asp:UpdatePanel ID="UpdatePanel1" runat="server">      

 <ContentTemplate>                  

   <asp:Login ID="Login1" runat="server" OnAuthenticate="OnAuthenticate" CssClass="modalPopup">

   </asp:Login>

<asp:Button ID="CancelButton" runat="server" Text="Cancel"></asp:Button>

 </ContentTemplate>

 </asp:UpdatePanel>        

</asp:Panel>      

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server"

TargetControlID="LoginStatus2"

PopupControlID="Panel2"

BackgroundCssClass="modalBackground"

CancelControlID="CancelButton"

DropShadow="true" >

</ajaxToolkit:ModalPopupExtender>

</AnonymousTemplate>

<LoggedInTemplate>

<asp:LoginStatus ID="LoginStatus2" OnLoggedOut="OnLoggedOut" runat="server" />

<asp:LoginName ID="LoginName1" runat="server" />

</LoggedInTemplate>

</asp:LoginView>  

</asp:Panel>

<ajaxToolkit:AlwaysVisibleControlExtender ID="AlwaysVisibleControlExtender1" runat="server"

TargetControlID="Panel1"

HorizontalSide="Right"

HorizontalOffset="0"

VerticalSide="Top"

VerticalOffset="5">

</ajaxToolkit:AlwaysVisibleControlExtender>

# September 6, 2007 4:09 AM

Dave said:

The AlwaysVisibleControlExtender  did the job!

Thanks.

# September 23, 2008 2:37 PM

hyder92 said:

thanx

# July 7, 2010 7:49 AM

hyder92 said:

how do go i create whole registration fields in popup up window

# July 7, 2010 7:49 AM