ASP:Login inside a Web User COntrol?

M

musosdev

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
 
E

Ed Murphy

musosdev said:
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?
 
M

musosdev

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!
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top