473,387 Members | 1,501 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,387 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 1823
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Citoyen du Monde | last post by:
Trying to get some ideas on a simple javascript project (to teach myself the language). I want to develop a client-side vocabulary practice application that would allow users to enter their own...
1
by: David Anderson | last post by:
I'm having trouble persisting viewstate information for webcontrols I've disabled via javascript. I have a group of textboxes that I enable/disable via a checkbox control that invokes a javascript...
0
by: Tomas Vera | last post by:
Here's another goofy thing. I need to persist the state of items added dynamically to a Panel control between round-trips to the server. I have a web form that contains a TreeView and a...
1
by: Charlie | last post by:
Hi, Is there a way of persisting state information for a server control without using ViewState? I'm currently using Page.Session() but I don't think this is the best way. What's the preferred...
1
by: lim | last post by:
What is the possible error that occurs when the Page_load event is not triggered during execution. In my page there's some basic server control. Is there any loops holes?
3
by: Stu | last post by:
Hi, I am creating a control in a PlaceHolder like so: Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim ctrl As...
0
by: =?Utf-8?B?SmltRg==?= | last post by:
We are building some new sites using .NET 2.0. We are trying to implement persisting ViewState site wide to SQL (as opposed to on a per application basis). I have successfully got the ViewState to...
1
by: cfps.Christian | last post by:
I have a web usercontrol on the form that dynamically builds itself and then when an item has been clicked it will allow me to get the object at the selected index. The problem I'm having is that...
1
by: =?Utf-8?B?VmlqYXkgQ2hpa3Rl?= | last post by:
Hi Experts, With Session Affinity and Web Server Farm on ISA Server 2006 accessing 2 backend IIS servers, I’m getting error “Validation of ViewState MAC failed. If this application is hosted...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.