views:

25

answers:

2

Hi there guys! I'm starting out learning some ASP.Net programming and I'm going to be making a little community website for my friends and myself.

I'm trying to pick up some good habits along the way.

I was thinking of having a usercontrol and have that 'loginBox' shows the appropriate textboxes and login button, but also show his username when he is logged in.

Do you think I should handle this as a user control or am I missing something as an ASP.Net newbie?

+2  A: 

It sounds like a good idea to me - the user control could easily be placed anywhere on the site that you wanted to prompt the user for their credentials. This is exactly the kind of scenario that user controls were designed for.

Andrew Hare
A: 

It's a good idea. But please don't forget to use MasterPages: You may want to just place the login and "is logged in" on the MasterPage (or you could wrap them in a WUC and use it once on the MasterPage).

Jakob Gade