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...

    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"
    UserNameLabelText="Username/Email: "

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

    OnLoggedIn="RedirectOnLogin" Width="100"

    Thanks for any help you can provide!

    musosdev, Aug 19, 2009
    1. Advertisements

  2. musosdev

    Ed Murphy Guest

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

  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!
    musosdev, Aug 19, 2009
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.