Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 8 of 8

Thread: add login module to home page

  1. #1
    dvdbglw is offline Member
    Join Date
    Jun 2009
    Posts
    44

    Default add login module to home page

    I would like to add a login section to the home page that goes away after signing into the site.

    Essentially I want signin.aspx combined with default.aspx.

    The issue I'm running into is multiple inheritance (not c# advisable/supported I realize). signin.aspx needs to inherit AspDotNetStorefront.signin and default.aspx needs to inherit AspDotNetStorefront._default.

    I merged the two into a copy of signin.aspx(.cs) by adding everything that was in default not existing in signin and it all worked by navigating directly to my new page. But of course it didn't inherit _default so going to mysite.com/ looked for default.aspx, found it, but was missing all the aspdotnetstorefront._default inherited code so it broke.

    Suggestions or questions at this point? I successfully added it to a v9 store thanks to master pages but having issues in this v8 store.

    ML 8.0.1.2/8.0.1.2

  2. #2
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    I just set the default.aspx page to redirect to signin.aspx if there was no logged in user.
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  3. #3
    dvdbglw is offline Member
    Join Date
    Jun 2009
    Posts
    44

    Default

    Thanks but we're not requiring users to log in. We just want the form available on the home page so they can log in quickly instead of having to click Login.

  4. #4
    sam.bengtson is offline Member
    Join Date
    Jan 2011
    Posts
    64

    Default

    I'm working on it as well and i'm getting close. I will post when finished

  5. #5
    sam.bengtson is offline Member
    Join Date
    Jan 2011
    Posts
    64

    Default

    alright here is what I did. It doesn't exactly work yet but maybe somebody can help us all out. Under the "leftWrap" div on the template page it goes like this:

    <div class="navHeader" "><asp:label id="headerLabel" Text="Please Log In" runat="server"></asp:label></div>
    <div class="leftNav" id="Div1">
    <form id="loggedIn" method="post" action="" >
    <div id="user" runat="server" visible="true" >
    <span id="Span1">(!USERNAME!)</span>
    You have (!NUM_CART_ITEMS!) item(s) in your <a class="username" href="shoppingcart.aspx">
    Cart</a>
    </div>
    </form>

    <form id="loggingIn" method="post" action="" >
    <div id="loginUser" runat="server" visible="falsesam">
    <label for="EMail">Username</label>
    <input id="EMail" name="EMail" type="text" size="10"/>
    <label for="txtPassword">Password</label>
    <input id="txtPassword" name="txtPassword" type="password" size="10"/>
    <br />
    <button onclick="LoginButton_Click" type="submit">Login</button><br />
    <br />
    <a href="../../createaccount.aspx">Create New Account</a>
    <br/>
    <a href="../../signin.aspx">Forget Password?</a>
    </div>
    </form>
    I wrote a c# function that switches between the two forms after checking if the user is logged in or not. The second form is the actual login module. But unfortunately I cannot get myself logged in using this. Can anybody use this code and figure it out?

  6. #6
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Hi

    Unfortunately, I think you'll need to build a slightly more complex solution than this because signin.aspx is a standalone page that takes a login button click event to trigger the actual sign in logic.

    If you call signin.aspx directly nothing will happen because the click event hasn't been triggered.

    If I was writing this, I would probably write an .ascx user control that could be placed on any page (such as the home page) that rendered a login form if the user wasn't logged in and then handled the signin logic when the link and/or button was clicked (using the same core code base as signin.aspx.cs).

    v9 does something similar with much of the signin code now moved to a user control.

    Adam

  7. #7
    mikemurphy is offline Senior Member
    Join Date
    Mar 2006
    Location
    United Kingdom
    Posts
    207

    Default

    isnt this what you are after.....let me know as i'm interested in this solution also

    http://www.aspdotnetstorefront-addon...torefront.aspx

    dont know who these guys are btw ?
    8.0.1.4 W2008R2 64-bit MSSQL2005

  8. #8
    dvdbglw is offline Member
    Join Date
    Jun 2009
    Posts
    44

    Default

    mikemurphy - That does look like it would have handled the situation we needed. However we did end up merging default.aspx and signin.aspx and it is working well for us.