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 / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

User name and password to activate buttons and hyperlinks on website

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jonny - 12 Oct 2007 16:59 GMT
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.
gnewsgroup - 12 Oct 2007 17:06 GMT
> 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
[quoted text clipped - 5 lines]
>
> 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;
}
jonny - 12 Oct 2007 17:10 GMT
> > 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
[quoted text clipped - 20 lines]
>
> - Show quoted text -

Is there a way to disable all the website links until (isValidUser).
(I am using VB.NET)
gnewsgroup - 12 Oct 2007 17:15 GMT
> > > 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
[quoted text clipped - 23 lines]
> 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 - 12 Oct 2007 17:19 GMT
> > > 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
[quoted text clipped - 23 lines]
> 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?

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.