LoginStatus control in Master page

A

AR

I am interested in the best approach for placing a LoginStatus control
in a Master page. The reason I'm doing this is so I can always display
the "Login" or "logout" link at the top of every page on my site.
However, this control needs to be placed inside a <form runat=server>
which means that any other page using this as their masterpage cannot
include a <form runat=server> tag because only one can ever be on a
page.

The easy approach is to place a <form runat=server> tag in my
masterpage surrounding the entire body and never include it in any
child pages, but this seems like overkill. Is there a better way to do
this? Is placing this control (or any other control that runs within a
form) on a masterpage discouraged?

<asp:LoginStatus
runat=server
LoginText="Click here to login"
LogoutText="Click here to logout"
LogoutAction=Redirect
LogoutPageUrl="~/default.aspx" />

Thanks in advance.
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,526
Members
44,997
Latest member
mileyka

Latest Threads

Top