I'm used to windows forms programming. Just tackling something in asp.net as
a web app - I have got to the point where I have a login form that works,
and on the resulting page I have a loginview. That page has a design layout
and a source layout, then I also have a code layout. In the code layout I
have written a function that only should be called if the user is logged in,
so, in the source for the page, how do I call my function in the "loggedin"
template of my LoginView?
I tried wrapping it in <code> tags but it just displays the name of the
function...
James.
Nicholas Paldino [.NET/C# MVP] - 30 Jun 2006 15:09 GMT
James,
How are you doing the login? Are you providing a custom membership
provider? ASP.NET 2.0 has a rich provider interface that will let you
create your principal (implementation of the IPrincipal interface) and
expose it to your pages.
Then, you would just check the User property on your page and if it is
null, you know the person is not logged in.
Check out the following article on forms authentication, it should help:
http://aspnet.4guysfromrolla.com/articles/120705-1.aspx
You can also check out the documentation in MSDN on implementing a
membership provider:
http://msdn2.microsoft.com/en-us/library/f1kyba5e.aspx
Hope this helps.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> I'm used to windows forms programming. Just tackling something in asp.net
> as a web app - I have got to the point where I have a login form that
[quoted text clipped - 7 lines]
>
> James.
james - 30 Jun 2006 16:38 GMT
> James,
>
[quoted text clipped - 5 lines]
> Then, you would just check the User property on your page and if it is
> null, you know the person is not logged in.
Thanks - page.user.identity was exactly the area I was looking for. All
seems working now, thanks for the help!
James.
chanmm - 30 Jun 2006 16:01 GMT
Cool down man, watch the video here might help you:
http://www.asp.net/Default.aspx?tabid=1
chanmm
> I'm used to windows forms programming. Just tackling something in asp.net
> as a web app - I have got to the point where I have a login form that
[quoted text clipped - 7 lines]
>
> James.