Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Thread Tools Search this Thread
Old 22-11-2009
Join Date: Nov 2009
Posts: 1
Post Asp.net-vb2008

I want to create a login page for my webform which has 24 textfields and gridview.user has to enter the username and password to see/validate the webform,can any one provide the solution to this ,helpfull any online tutorial
Reply With Quote
Old 28-05-2011
Join Date: May 2009
Posts: 673
Re: Asp.net-vb2008

I want you to just follow the below mention code because i guess it will give you fair idea regarding the same. I hope that it will help you to develop your own program.
bLoggedIn = (len(session("UserName")) > 0) 

if bRequireLogin then
   'Login required
   if Not bLoggedIn then
     'Not logged in, ask for login
     response.redirect "login.asp?comebackto=" & _ 
     request.servervariables("script_name") & "?" & _ 
     'Note how we construct the page to come back
   end if
end if

if request("comebackto") <> "" then
   sReferer = request("comebackto")
   sGoBackTo = "?" & request.querystring
end if

if request("cmdLogin") <> "" then

   'Login Form submitted
   sUserName = request("txtUserName")
   sPassword = request("txtPassword")

   'Check for username and password

   if sUserName = "bill" And sPassword = "gates" then
     bLoginSuccessful = True
   end if

   session("UserName") = sUserName 
if sReferer = "" then
     response.redirect "index.asp"
     response.redirect sReferer
   end if


   'Display the Login Form


   <form action="login.asp<%=sGoBackTo%>" method="post">
     <input type="text" name="txtUserName"><br>
     <input type="password" name="txtPassword"><br>
     <input type="submit" name="cmdLogin"><br>


end if

Now, all you need to do is setting bRequireLogin to True and including the security.asp file. 

   bRequireLogin = True

Reply With Quote

  TechArena Community > Software > Software Development
Tags: , ,

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads for: "Asp.net-vb2008"
Thread Thread Starter Forum Replies Last Post
Access to data VB2008 Pratap Gad Software Development 3 26-03-2009 11:33 AM

All times are GMT +5.5. The time now is 02:18 PM.