ASP:Login inside a Web User COntrol?

Discussion in 'ASP .Net Web Controls' started by musosdev, Aug 19, 2009.

  1. musosdev

    musosdev Guest

    Hi guys

    I have a nice login box all setup that I need to use on multiple pages of my
    website. Seems simple enough... I drop the asp:Login onto the WUC and add
    that to the pages that I need, right?

    Well, I'm getting an error...

    System.Web.HttpParseException:
    c:\Code\SVN\Musoswire\Website\_webctrl\MusoswireLogin.ascx(3): error CS1061:
    'ASP._webctrl_musoswirelogin_ascx' does not contain a definition for
    'RedirectOnLogin' and no extension method 'RedirectOnLogin' accepting a first
    argument of type

    What do I need to do to enable this?

    Basically, all I want is to encapsulate my login control, so I don't have to
    change all the settings in multiple locations.

    Here's my asp:Login...

    <asp:Login ID="loginForm"
    MembershipProvider="NHMembershipProvider"
    UserNameLabelText="Username/Email: "

    LabelStyle-CssClass ="login"
    UserNameRequiredErrorMessage="Please enter a username"
    PasswordLabelText="Password: "
    PasswordRequiredErrorMessage="Please enter a password"
    InstructionText="Your Musoswire Account..."
    DisplayRememberMe="false"

    TitleText=""
    runat="server"
    LoginButtonStyle-CssClass="button"
    OnLoggedIn="RedirectOnLogin" Width="100"
    />

    Thanks for any help you can provide!


    Dan
     
    musosdev, Aug 19, 2009
    #1
    1. Advertising

  2. musosdev

    Ed Murphy Guest

    musosdev wrote:

    > I have a nice login box all setup that I need to use on multiple pages of my
    > website. Seems simple enough... I drop the asp:Login onto the WUC and add
    > that to the pages that I need, right?
    >
    > Well, I'm getting an error...


    Would it be more or less work to move it into a master page?
     
    Ed Murphy, Aug 19, 2009
    #2
    1. Advertising

  3. musosdev

    musosdev Guest

    Thanks for the reply Ed.

    It would be more difficult I think, cos I only want it on certain pages. The
    good news is I sorted it! There was some codebehind I'd missed while copying
    - whoops!

    Once I got that, I had to change User.Identity references to
    System.Web.HttpContext.Current.User.Identity and all seems to be working!



    "Ed Murphy" wrote:

    > musosdev wrote:
    >
    > > I have a nice login box all setup that I need to use on multiple pages of my
    > > website. Seems simple enough... I drop the asp:Login onto the WUC and add
    > > that to the pages that I need, right?
    > >
    > > Well, I'm getting an error...

    >
    > Would it be more or less work to move it into a master page?
    >
     
    musosdev, Aug 19, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vatech1993
    Replies:
    4
    Views:
    5,693
    =?Utf-8?B?U8Opcmdpbw==?=
    Dec 11, 2004
  2. Leeor Chernov
    Replies:
    2
    Views:
    793
    Leeor Chernov
    Oct 16, 2005
  3. Tony Johansson
    Replies:
    3
    Views:
    16,250
    Patrice
    Jan 2, 2010
  4. Roman
    Replies:
    2
    Views:
    265
    Roman
    Jan 4, 2005
  5. Kiran More
    Replies:
    2
    Views:
    319
    Kiran More
    Nov 14, 2006
Loading...

Share This Page