•
•
•
•
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
![]() |
•
•
Join Date: Oct 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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.
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.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Web Developers' Lounge Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
adult advertising blog browser browsers browsing community data design development devices domains firefox google html india internet java legal linux marketing math merger microsoft mobile applications mozilla msn multimedia news php privacy report research search security sex social networking software technology users video w3c web web development wiki wikipedia xml yahoo youtube
- PostBackURL vs. Response.Redirect (ASP.NET)
- i want to send labelbox value with redirect page (ASP.NET)
- ASP Redirect on Session Timeout (ASP.NET)
- asp redirect help I think it is a syntax issue (Legacy and Other Languages)
- The best way to redirect visitors... (JavaScript / DHTML / AJAX)
- response.redirect not functioning (ASP)
Other Threads in the Web Developers' Lounge Forum
- Previous Thread: Stopping Hotlinking
- Next Thread: entry level jobs???


Linear Mode