Persisting viewstate information between HTTP/HTTPS?

C

Chris Ashley

Is it possible to persist viewstate information between HTTP and HTTPS
(on the same page obviously)? Trying to get around writing some messy
state transfer code... it doesn't seem to work if I use
response.redirect.
 
M

Mr Newbie

What about using Server.Transfer which has the ability to preserve the
context of the pevious page ? Or have I misunderstood you ??

Mr N.
 
C

Chris Ashley

Mr said:
What about using Server.Transfer which has the ability to preserve the
context of the pevious page ? Or have I misunderstood you ??

Mr N.

Sorry, I don't think I explained myself well enough.

Basically I have a webform which is wizard style with a number of
'pages'. The last step needs to use HTTPS but submit to the same form.
I know I can do this using client side script to override the form
action but that's not ideal.

EG:

switch (wizardStep)
{
case 1:
// Needs to be http
infoPanel.Visible = true;
break;
case 2:
// Needs to be http
declarationPanel.Visible = true;
case 3:
// Needs to be https
paymentPanel.Visible = true;
}

I know I can do this by just making a separate form, or adding some
code to pass values across, but just wondered if there was a neater way
that I'm missing?

Thanks,

Chris
 
M

Mr Newbie

This may help

If you need to use absolute URLs, resort to a little trick and manually add
the session ID to the URL. You use the ApplyAppPathModifier method on the
HttpResponse class.

<a runat="server"
href=<% =Response.ApplyAppPathModifier("/code/page.aspx")%> >Click</a>
The ApplyAppPathModifier method takes a string representing a URL and
returns an absolute URL, which embeds session information. For example, this
trick is especially useful in situations in which you need to redirect from
a HTTP page to an HTTPS page.
 

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,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top