www.webdeveloper.com
Results 1 to 4 of 4

Thread: How to customize menu of a website ???

  1. #1
    Join Date
    Aug 2006
    Posts
    48

    Question How to customize menu of a website ???

    Hi all !.I'm using .NET 2003
    In my site ,I want to customize the menu of the site.For instance,when user logged in then menu Login become Log out .
    Can any one give me an advice .
    Thanks you very much !

  2. #2
    Join Date
    Apr 2006
    Location
    Toronto
    Posts
    18
    http://asp.net/learn/videos/default.aspx?tabid=63

    They have 3 video tutorials on login and profile management

  3. #3
    Join Date
    Apr 2005
    Posts
    634
    while those video clips are great resources for learning how to implement .net programming into once application, if you pay attention to nobitavn94's original post, he is using vs.net2003 which is .net 1.x, not 2.0.

    login and profile management from those video clips are for 2.0, which needs to be using vs.net 2005 or vwd.

    unless nobitavn94 is ready to move to 2.0, those video clips would be waste his(her) time without resolution.

  4. #4
    Join Date
    Apr 2005
    Posts
    634
    Unless you purchase a third party component; there is no built-in role management support in .net 1.x.

    You'll have to implement the whole thing by yourself (which is really not that bad). There are many ways to handle it, but off the top of my head, this is what I would do:

    1) make 2 menus using User Control ascx, 1 with "sign in " link and the other one with "log out" link.

    2) in your aspx page(s), put a placeholder control as where you think the menu should be located.

    3) store a username/password somewhere in your sessions, and default name/password to something bogus.

    4) I assume you use FormAuthentication to manage logged in user, so you do the following under your page_load method:
    Code:
    //grab username/password from sessions...
    Control con;
    if (FormsAuthentication.Authenticate(UserName, UserPassword)) 
      con = LoadControl ("login.ascx");
    else
      con = LoadControl ("logout.ascx");
    
    myPlaceHolder.Controls.Add(con);
    Last edited by sirpelidor; 11-13-2006 at 01:09 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles