By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 2,069 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.