views:

166

answers:

3

I’ve used the asp.net login control on my sharepoint custom master page. All works well and I can login to my site without problems.

However I’d like to run some code once the user has logged, or alternatively perform a redirect based on the user’s role.

Has anyone does this type of thing before?

+1  A: 

You can test roles programmatically through User.IsInRole

EDIT: on redirect from the ASP.NET login control, check for the forms authenication token and run your custom code if the token is present.

Mitch Wheat
A: 

OK cool, but do you know of any way i can attach my own code to run when the user clicks the 'log-in' button?

Rob
+1  A: 

The Login control (System.Web.UI.WebControls.Login) has an event LoggedIn (http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.login.loggedin.aspx). Just subscribe to it and place your code in the handler. I haven't worked with sharepoint, I'm talking from an ASP.NET viewpoint here.

Slavo
doh! think i made that more difficult than it need to be, thanks for you help :-)
Rob