User name and password to activate buttons and hyperlinks on website

J

jonny

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.
 
G

gnewsgroup

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;
}
 
J

jonny

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)
 
G

gnewsgroup

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.
 
G

gnewsgroup

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top