471,337 Members | 1,125 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Persisting viewstate information between HTTP/HTTPS?

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.

Nov 19 '05 #1
4 1695
What about using Server.Transfer which has the ability to preserve the
context of the pevious page ? Or have I misunderstood you ??

Mr N.
"Chris Ashley" <ch***********@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
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.

Nov 19 '05 #2

Mr Newbie wrote:
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

Nov 19 '05 #3
Why not use HTTPS for all the stages, will this not work ?


"Chris Ashley" <ch***********@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...

Mr Newbie wrote:
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

Nov 19 '05 #4
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.
"Chris Ashley" <ch***********@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...

Mr Newbie wrote:
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

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Citoyen du Monde | last post: by
1 post views Thread by David Anderson | last post: by
reply views Thread by Tomas Vera | last post: by
1 post views Thread by Charlie | last post: by
1 post views Thread by lim | last post: by
reply views Thread by =?Utf-8?B?SmltRg==?= | last post: by
1 post views Thread by cfps.Christian | last post: by
1 post views Thread by =?Utf-8?B?VmlqYXkgQ2hpa3Rl?= | last post: by
reply views Thread by rosydwin | last post: by

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.