User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Web Developers' Lounge section within the Web Development category of DaniWeb, a massive community of 456,575 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,582 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Web Developers' Lounge advertiser: Search Engine Optimization
Views: 793 | Replies: 0
Reply
Join Date: Oct 2007
Posts: 1
Reputation: pavanbh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
pavanbh pavanbh is offline Offline
Newbie Poster

Response.Redirect

  #1  
Oct 28th, 2007
I am writing code to create a cookie for my site in vb.net and am using the following code in the login button click procedure. When I enter the username and password and click login, I am taken back to the login page again, when I expect to be taken to Default.aspx, that is a welcome page.

Dim newCookie As HttpCookie = New HttpCookie("User")
newCookie.Values.Add("Name", Login1.UserName)
newCookie.Values.Add("Access", ddlALevel.SelectedValue)
newCookie.Expires = DateTime.Now.AddMinutes(1)
Response.Cookies.Add(newCookie)

Dim strRedirect As String
MsgBox(Request("ReturnURL"))
strRedirect = Request("ReturnURL")
If strRedirect <> "" Then
Response.Redirect(strRedirect, True)
Else
strRedirect = "/New_Hospital/Default.aspx"
Response.Redirect(strRedirect, True)
End If

Any idea what am i doing wrong?
Thanks.
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Web Developers' Lounge Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Web Developers' Lounge Forum

All times are GMT -4. The time now is 6:12 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC