473,385 Members | 1,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Why does the ReturnUrl vanish and what can be done to prevent that? (again)

Ok so my previous message about the vanishing ReturnUrl value was also
lost! - grrrr Fate - I'll get my revenge on you - if you think you can
toy with me like this!

I decided to change the form to an asp.net one:

if(!Page.IsPostBack)
hidReturnUrl.Value = Request.QueryString["ReturnUrl"];
else
hidReturnUrl.Value = Request.Form["hidReturnUrl"];

<form method="post" id="frmMain" runat="server">
<div>
<asp:HiddenField ID="hidReturnUrl" runat="server" />
... etc.

from:

<form method="post" id="frmMain"
action="default.aspx<%if(Request.QueryString["ReturnUrl"] !
= null) Response.Write("?ReturnUrl=" +
Request.QueryString["ReturnUrl"]);%" >

Yet still the ReturnUrl in the querystring vanishes and the value in
hidReturnUrl is not kept across form posts.

Now, with the asp.net form, I can see a viewstate variable where
previously there was none. In both cases there two form fields are
html textbox elements (one for username and one for password).

Yet again I ask why is the ReturnUrl vanishing? and what can I do
about that? apart from making my login page a completely conventional
asp.net one (with login controls and all that rubbish).

PS: why did Google eat my last post?

Apr 25 '07 #1
1 2031
the hidden fields rendered name is probably not "hidReturnUrl". use the
control:

if(!Page.IsPostBack)
hidReturnUrl.Value = Request.QueryString["ReturnUrl"];
else
hidReturnUrl.Value = hidReturnUrl.Text;
-- bruce (sqlwork.com)

mark4asp wrote:
Ok so my previous message about the vanishing ReturnUrl value was also
lost! - grrrr Fate - I'll get my revenge on you - if you think you can
toy with me like this!

I decided to change the form to an asp.net one:

if(!Page.IsPostBack)
hidReturnUrl.Value = Request.QueryString["ReturnUrl"];
else
hidReturnUrl.Value = Request.Form["hidReturnUrl"];

<form method="post" id="frmMain" runat="server">
<div>
<asp:HiddenField ID="hidReturnUrl" runat="server" />
... etc.

from:

<form method="post" id="frmMain"
action="default.aspx<%if(Request.QueryString["ReturnUrl"] !
= null) Response.Write("?ReturnUrl=" +
Request.QueryString["ReturnUrl"]);%" >

Yet still the ReturnUrl in the querystring vanishes and the value in
hidReturnUrl is not kept across form posts.

Now, with the asp.net form, I can see a viewstate variable where
previously there was none. In both cases there two form fields are
html textbox elements (one for username and one for password).

Yet again I ask why is the ReturnUrl vanishing? and what can I do
about that? apart from making my login page a completely conventional
asp.net one (with login controls and all that rubbish).

PS: why did Google eat my last post?
Apr 25 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Mariam | last post by:
Hi, all, We have mutiple ASP.NET web applications and setup on mutiple web servers (win2k, .netframework 1.1). All the web applications are setup to use Forms authentication. All the applications...
0
by: Tomk | last post by:
When I logout of my application I redirect to the login page. However the ReturnURL is placed in the querystring so if the user logs back in it goes back to the last page where the logout occured....
4
by: Chicagoboy27 | last post by:
All I am trying to find a solution for removing the ?returnUrl if a user is not authenticated. I want to be redirect an unauthenticated user to the login.aspx less the returnUrl. Once they log...
7
by: vvkl | last post by:
I have readed a example code from MSDN about FormsAuthenticationTicket calss, but there's a line I can't understand : 'strRedirect = Request;' What's the mean in which square brackets? Thank...
0
by: mark4asp | last post by:
The login page is: http://localhost:1086/Client/Default.aspx The default page is: http://localhost:1086/Client/News/News.aspx i.e. I have the following in web.config <authentication...
10
by: semomaniz | last post by:
Hello, I have a database interface that needs to have a login authentication set up. SO for this I have a login view inside which i have the login control and i have accomplished the...
0
by: tranky | last post by:
Hi, i've a problem, and i know you can help me to solve it. I'm using Asp Net and Form Authentication. When i'm anonymous and i must show a protected page, i'm redirected into a login.aspx page...
1
by: tranky | last post by:
Hi, i've a problem, and i know you can help me to solve it. I'm using Asp Net and Form Authentication. When i'm anonymous and i must show a protected page, i'm redirected into a login.aspx page...
0
by: tranky | last post by:
Hi, i've a problem, and i know you can help me to solve it. I'm using Asp Net and Form Authentication. When i'm anonymous and i must show a protected page, i'm redirected into a login.aspx page...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.