Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2006

Tip: Looking for answers? Try searching our database.

I hate to ask, but...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
james - 30 Jun 2006 14:40 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.