User name and password to activate buttons and hyperlinks on website

Discussion in 'ASP .Net' started by jonny, Oct 12, 2007.

  1. jonny

    jonny Guest

    I would like to add a password and user name to my website. If the
    username and password is correct than activate the hyperlinks and
    buttons.

    Could you please share some code how how to achieve this? I have
    several buttons and links on my home page and do not want it to be
    active until the user enters the correct password.

    Using ASP.NET with Visual Studio 2005.
    jonny, Oct 12, 2007
    #1
    1. Advertising

  2. jonny

    gnewsgroup Guest

    On Oct 12, 11:59 am, jonny <> wrote:
    > I would like to add a password and user name to my website. If the
    > username and password is correct than activate the hyperlinks and
    > buttons.
    >
    > Could you please share some code how how to achieve this? I have
    > several buttons and links on my home page and do not want it to be
    > active until the user enters the correct password.
    >
    > Using ASP.NET with Visual Studio 2005.


    Make your buttons disabled by default, and enable it only when the
    username/password are correct.

    if (isValidUser)
    {
    myButton.Enabled = true;
    }
    else
    {
    myButton.Enabled = false;
    }
    gnewsgroup, Oct 12, 2007
    #2
    1. Advertising

  3. jonny

    jonny Guest

    On Oct 12, 11:06 am, gnewsgroup <> wrote:
    > On Oct 12, 11:59 am, jonny <> wrote:
    >
    > > I would like to add a password and user name to my website. If the
    > > username and password is correct than activate the hyperlinks and
    > > buttons.

    >
    > > Could you please share some code how how to achieve this? I have
    > > several buttons and links on my home page and do not want it to be
    > > active until the user enters the correct password.

    >
    > > Using ASP.NET with Visual Studio 2005.

    >
    > Make your buttons disabled by default, and enable it only when the
    > username/password are correct.
    >
    > if (isValidUser)
    > {
    > myButton.Enabled = true;}
    >
    > else
    > {
    > myButton.Enabled = false;
    >
    >
    >
    > }- Hide quoted text -
    >
    > - Show quoted text -


    Is there a way to disable all the website links until (isValidUser).
    (I am using VB.NET)
    jonny, Oct 12, 2007
    #3
  4. jonny

    gnewsgroup Guest

    On Oct 12, 12:10 pm, jonny <> wrote:
    > On Oct 12, 11:06 am, gnewsgroup <> wrote:
    >
    >
    >
    > > On Oct 12, 11:59 am, jonny <> wrote:

    >
    > > > I would like to add a password and user name to my website. If the
    > > > username and password is correct than activate the hyperlinks and
    > > > buttons.

    >
    > > > Could you please share some code how how to achieve this? I have
    > > > several buttons and links on my home page and do not want it to be
    > > > active until the user enters the correct password.

    >
    > > > Using ASP.NET with Visual Studio 2005.

    >
    > > Make your buttons disabled by default, and enable it only when the
    > > username/password are correct.

    >
    > > if (isValidUser)
    > > {
    > > myButton.Enabled = true;}

    >
    > > else
    > > {
    > > myButton.Enabled = false;

    >
    > > }- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > Is there a way to disable all the website links until (isValidUser).
    > (I am using VB.NET)


    Yes, you can. If you don't wanna manually disable each link through
    hard-code, you will have to recursively iterate through all controls
    in your page, and disable your links.

    Search recursive find controls, and you'll get a bunch.
    gnewsgroup, Oct 12, 2007
    #4
  5. jonny

    gnewsgroup Guest

    On Oct 12, 12:10 pm, jonny <> wrote:
    > On Oct 12, 11:06 am, gnewsgroup <> wrote:
    >
    >
    >
    > > On Oct 12, 11:59 am, jonny <> wrote:

    >
    > > > I would like to add a password and user name to my website. If the
    > > > username and password is correct than activate the hyperlinks and
    > > > buttons.

    >
    > > > Could you please share some code how how to achieve this? I have
    > > > several buttons and links on my home page and do not want it to be
    > > > active until the user enters the correct password.

    >
    > > > Using ASP.NET with Visual Studio 2005.

    >
    > > Make your buttons disabled by default, and enable it only when the
    > > username/password are correct.

    >
    > > if (isValidUser)
    > > {
    > > myButton.Enabled = true;}

    >
    > > else
    > > {
    > > myButton.Enabled = false;

    >
    > > }- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > Is there a way to disable all the website links until (isValidUser).
    > (I am using VB.NET)


    By the way, I just notice that you want to disable all website
    (instead of a single page) links until authentication passes. I
    understand that each application is different from the other, but why
    do you need to do so?
    gnewsgroup, Oct 12, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AAaron123
    Replies:
    2
    Views:
    2,132
    AAaron123
    Jan 16, 2009
  2. AAaron123
    Replies:
    1
    Views:
    1,331
    Oriane
    Jan 16, 2009
  3. Ofer
    Replies:
    2
    Views:
    430
  4. Junkone
    Replies:
    2
    Views:
    206
    Jarmo Pertman
    Oct 27, 2010
  5. Syswatch
    Replies:
    3
    Views:
    123
Loading...

Share This Page