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

M

mark4asp

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?
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top