Login Page

Oct 27, 2009 at 10:12 PM

Hi

I was able to compile the project. Great !

*I learned that i could not run in under a virtual directory but only as new web site...can you confirm ?

*I'm now trying to use it : first i tried to create a Login.aspx page to host the login pane instead of having it on the home page. But it always fail returning a 404 error (i pasted the code from the Master page)

*I experienced  difficulities when moving pages in admin. It said, after i created a new page and tried to move : key is null...How is it possible ?

Thanks again

John

Coordinator
Oct 28, 2009 at 7:53 AM
jweizman wrote:

Hi

I was able to compile the project. Great !

*I learned that i could not run in under a virtual directory but only as new web site...can you confirm ?  >>>> Yes, you have to create a web site in IIS.

*I'm now trying to use it : first i tried to create a Login.aspx page to host the login pane instead of having it on the home page. But it always fail returning a 404 error (i pasted the code from the Master page) >>>> All pages need to pass the UrlRewriter, so your login.apsx needs to be registered in one of the sitemap xml files. You may want to put it in the file Web.en.sitemap. When you leave the menutitle attribute empty, it won't show up in the menu. When you set the authentication attribute to "anonymous" it won't show up once people are signed in. Some url extensions will always pass the UrlRewriter, these are listed in the setting UrlRewriter_IgnoreUrlRegex.

*I experienced  difficulities when moving pages in admin. It said, after i created a new page and tried to move : key is null...How is it possible ? >>>> This is a bug that is solved but not yet published. There is an easy workaround: click once on "sitemap ?", from then on it will work forever.

Thanks again

John

Hope this helps. I am working on a small explanation of the properties menu, please check the tutorials on smallcms.net later this week.

Oct 28, 2009 at 9:51 AM
Yes it helps a lot actually. Thank you.
 
Following you help i added the login page to the sitemap and it is diplayed.
I tried to move the following code from the Maste page to the login page (because i want to login to occur in a diffent page):
 

<%

-- Header --%>

<asp:LoginView runat="server">

<AnonymousTemplate>

<asp:Login runat="server" DestinationPageUrl="/" FailureAction="RedirectToLoginPage" />

</AnonymousTemplate>

<LoggedInTemplate>

<asp:LoginName runat="server" />

<asp:LoginStatus runat="server" LogoutAction="Redirect" LogoutPageUrl="/" />

</LoggedInTemplate>

</asp:LoginView>

But is does not work. the Login box is not displayed. what am i missing there ?

Thanks
John


Jonathan Weizman

Coordinator
Oct 28, 2009 at 7:28 PM

Maybe you are signed in ? In that case you will only see the logout link. You may want to try the code below (tested):

  1. <%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Website.Login" %>
  2.  
  3. <asp:Content ID="C" ContentPlaceHolderID="CPH1" runat="server">
  4.  
  5.     <CMS:HtmlEditor runat="server" ContentKey="maintext" Style="width:auto;height:auto" />
  6.  
  7.     <asp:LoginView runat="server">
  8.         <AnonymousTemplate>
  9.             <div style="float:left">
  10.                 <asp:Login runat="server" DestinationPageUrl="/" FailureAction="RedirectToLoginPage" />
  11.             </div>
  12.             <div style="float:left">
  13.                 <a href="/Register.aspx">Sign Up</a>
  14.             </div>
  15.         </AnonymousTemplate>
  16.         <LoggedInTemplate>
  17.             <asp:LoginName runat="server" />
  18.             <asp:LoginStatus runat="server" LogoutAction="Redirect" LogoutPageUrl="/" />
  19.         </LoggedInTemplate>
  20.     </asp:LoginView>
  21.  
  22. </asp:Content>
  23.  
Oct 29, 2009 at 8:33 AM
Again thank you for your exceptionnal support.
I created the LoginPage and removed the <asp:LoginView> tag from the Master page.
I put this line in the Web.en.sitemap

<

siteMapNode url="/login.aspx" title="Login" menutitle="" template="/ArticleTemplate.aspx" state="published" code="tutor" lastmod="2009-10-27T11:26" description="login" keywords="" roles="" maintext="" authentication="Both"/>

It does not matter... it does not display.
 
 

Jonathan Weizman
Coordinator
Oct 29, 2009 at 8:53 AM
Edited Oct 29, 2009 at 8:55 AM

Try template="/login.aspx"

The sitemap defines the mappings from the url in your browser to the executed page in your project. So now you have url="/login.aspx" mapping to template="/login.aspx".

This may look silly, but imagin you wanted to have different login pages, for example to support multiple languages. You could add another siteMapNode that maps url="/inloggen.aspx" to template="/login.aspx". Or you may want to use extensionless urls (IIS7 only), then you could map url="/login" to template="/login.aspx".

 

Oct 29, 2009 at 9:14 AM
Bingo !
Thank you very much !
Jonathan Weizman