Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Classic ASP, <SELECT> postback, Browser Navigation

Reply
Thread Tools

Classic ASP, <SELECT> postback, Browser Navigation

 
 
Jai Singh
Guest
Posts: n/a
 
      06-17-2009
I am new to Classic ASP development and web development in general. I am
working on a data entry page in Classic ASP that preservers state through the
Session object.

I have on HTML FORM <SELECT> combo that provides a list of countries.
I have wired this up to cause a postback via "<select name=""txtCountryID""
size=""1"" onchange=""mainform.submit()"">".

In the asp page I respond to this post back and I change the input type of
another data entry field based upon the current value of the txtCountryID
<SELECT> control.
Meaning, another control is switched to either an <INPUT type="text" or an
<SELECT> itself.

For example, if the Country is US then the state data entry field is a list
of predefined states via a select combo, but if Country is CN then the state
data entry field is a blank text input.

The problem that I notice is that a user can use the Browsers navigation
buttons to move back to a pre-existing page. In some situations the
following occurs...

User chooses country US and selects a state from the state select list of CA
and then changes the country to CN and the state field changes, correctly, to
an input text that is empty.

User navs to prior page via browser.

Page now displays the Country of CN with the state <SELECT> that has a value
of CA!

I detect no post-back in my page when the browser navigation occurs.

What is the proper way to create the user interaction and deal with this
problem?

Thanks in advance,
Jai Singh
 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      06-17-2009
Jai Singh wrote:
> I am new to Classic ASP development and web development in general.
> I am working on a data entry page in Classic ASP that preservers
> state through the Session object.
>
> I have on HTML FORM <SELECT> combo that provides a list of countries.


There is no such thing as a "<SELECT> combo" but that's just a nitpick.
What you have is a SELECT element.

> I have wired this up to cause a postback via "<select
> name=""txtCountryID"" size=""1"" onchange=""mainform.submit()"">".
>
> In the asp page I respond to this post back and I change the input
> type of another data entry field based upon the current value of the
> txtCountryID <SELECT> control.
> Meaning, another control is switched to either an <INPUT type="text"
> or an <SELECT> itself.
>
> For example, if the Country is US then the state data entry field is
> a list of predefined states via a select combo, but if Country is CN
> then the state data entry field is a blank text input.
>
> The problem that I notice is that a user can use the Browsers
> navigation buttons to move back to a pre-existing page. In some
> situations the following occurs...
>
> User chooses country US and selects a state from the state select
> list of CA and then changes the country to CN and the state field
> changes, correctly, to an input text that is empty.
>
> User navs to prior page via browser.
>
> Page now displays the Country of CN with the state <SELECT> that has
> a value of CA!
>
> I detect no post-back in my page when the browser navigation occurs.
>
> What is the proper way to create the user interaction and deal with
> this problem?
>

What is the intended behavior? What do you want the user to see when he
navigates back to a page in history?
--
HTH,
Bob Barrows


 
Reply With Quote
 
 
 
 
Adrienne Boswell
Guest
Posts: n/a
 
      06-17-2009
Gazing into my crystal ball I observed =?Utf-8?B?SmFpIFNpbmdo?=
<(E-Mail Removed)> writing in
news:(E-Mail Removed):

> I am new to Classic ASP development and web development in general. I
> am working on a data entry page in Classic ASP that preservers state
> through the Session object.
>
> I have on HTML FORM <SELECT> combo that provides a list of countries.
> I have wired this up to cause a postback via "<select
> name=""txtCountryID"" size=""1"" onchange=""mainform.submit()"">".
>
> In the asp page I respond to this post back and I change the input
> type of another data entry field based upon the current value of the
> txtCountryID
><SELECT> control.
> Meaning, another control is switched to either an <INPUT type="text"
> or an
><SELECT> itself.
>
> For example, if the Country is US then the state data entry field is a
> list of predefined states via a select combo, but if Country is CN
> then the state data entry field is a blank text input.
>
> The problem that I notice is that a user can use the Browsers
> navigation buttons to move back to a pre-existing page. In some
> situations the following occurs...
>
> User chooses country US and selects a state from the state select list
> of CA and then changes the country to CN and the state field changes,
> correctly, to an input text that is empty.
>
> User navs to prior page via browser.
>
> Page now displays the Country of CN with the state <SELECT> that has a
> value of CA!
>
> I detect no post-back in my page when the browser navigation occurs.
>
> What is the proper way to create the user interaction and deal with
> this problem?
>
> Thanks in advance,
> Jai Singh
>


ASP knows nothing of what is going on client side, and this is a client
side issue. You would be better off posting to a client side group,
perhaps alt.html or comp.lang.javascript (if you are going to post to
more than one group, please Cross post, don't multipost).

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

 
Reply With Quote
 
Jai Singh
Guest
Posts: n/a
 
      06-17-2009
Bob,

Well, if at all possible, I certainly would like to avoid a cached situation
in which the HTML form is displayed with mis-matched controls (i.e. Country
is
CN but has a <select> drop down of US states).

I did a little google-research and discovered some serverside scripting
techinques for controlling clientside caching. By adding the following to
the beginning of the .asp page....

Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "Cache-Control", "no-cache"
Response.AddHeader "Cache-Control", "private"
Response.AddHeader "Cache-Control", "no-store"
Response.AddHeader "Cache-Control", "must-revalidate"
Response.AddHeader "Cache-Control", "max-stale=0"
Response.AddHeader "Cache-Control", "post-check=0"
Response.AddHeader "Cache-Control", "pre-check=0"
Response.AddHeader "Keep-Alive", "timeout=3, max=993"
Response.AddHeader "Expires", "Mon, 26 Jul 1997 05:00:00 GMT"
Response.Expires = -1
Response.Buffer = True

..the HTTP header is modified to, hopefully, prevent the client side cache of
the .asp page and thus force a postback when the Browswer's Navigation button
is utilized.

Jai Singh

Bob Barrows" wrote:
> What is the intended behavior? What do you want the user to see when he
> navigates back to a page in history?
> --
> HTH,
> Bob Barrows


 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      06-17-2009
Jai Singh wrote on 17 jun 2009 in microsoft.public.inetserver.asp.general:

> Response.AddHeader "Expires", "Mon, 26 Jul 1997 05:00:00 GMT"


What's so special about this date

"Mon, 26 Jul 1997 05:00:00 GMT"

That it gives 95,900 Google hits?

Or are you all copying and copying and copying and copying
code you do not understand?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
Jai Singh
Guest
Posts: n/a
 
      06-18-2009
Evertjan,

If you are going to bother to post in a public forum whose sole purpose is
to allow developers to learn about topics and review code samples... then
please make it useful. People would not be posting here if they had all of
the answers.

When I posted previously I gave samples of techniques that I had learned
about via public forums and some of those code lines were duplicates of one
other. But, essentially, it is my understanding that they are modifying the
HTTP Header in order to notify the browser (be it IE, Safari, etc.) that it
should not cache the .asp page in utilization.

In Actuality I finally decided to use Response.AddHeader "Expires", 0.

If you have anything of educational value to contribute then please do so.

Jai Singh

"Evertjan." wrote:

> Jai Singh wrote on 17 jun 2009 in microsoft.public.inetserver.asp.general:
>
> > Response.AddHeader "Expires", "Mon, 26 Jul 1997 05:00:00 GMT"

>
> What's so special about this date
>
> "Mon, 26 Jul 1997 05:00:00 GMT"
>
> That it gives 95,900 Google hits?
>
> Or are you all copying and copying and copying and copying
> code you do not understand?
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
>

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      06-18-2009
Jai Singh wrote on 18 jun 2009 in
microsoft.public.inetserver.asp.general:

> "Evertjan." wrote:
>
>> Jai Singh wrote on 17 jun 2009 in
>> microsoft.public.inetserver.asp.general:
>>
>> > Response.AddHeader "Expires", "Mon, 26 Jul 1997 05:00:00 GMT"

>>
>> What's so special about this date
>>
>> "Mon, 26 Jul 1997 05:00:00 GMT"
>>
>> That it gives 95,900 Google hits?
>>
>> Or are you all copying and copying and copying and copying
>> code you do not understand?


[Please do not toppost on usenet]
[please do not quote signatures on usenet]

> Evertjan,
>
> If you are going to bother to post in a public forum whose sole
> purpose is to allow developers to learn about topics and review code
> samples... then please make it useful.


You are so wrong, Jai,

This is not just a public forum but usenet.

Usenet NGs do not have such "sole purpose"s.

> People would not be posting
> here if they had all of the answers.


You wrongly suspect I am asking you personally.
I would have written you an email, if that were the case.

My "Are you all ...?" shows I was replying to the NG in general,
but I do not mind if you feel personally also spoken too by "copying and
copying and copying and copying", though I doubt if you could be the
source of 95,900 Google hits.

And why should I have to be responding with something usefull?
This is usenet, not a paid helpdesk.

> When I posted previously I gave samples of techniques that I had
> learned about via public forums and some of those code lines were
> duplicates of one other. But, essentially, it is my understanding
> that they are modifying the HTTP Header in order to notify the browser
> (be it IE, Safari, etc.) that it should not cache the .asp page in
> utilization.


Good for you, but these lines are not modifying header lines, and not
modifying in order to anything, they are just adding header lines.

My question in another form:
"What was your reason of picking this special date?"
could be quite unuseful to you, but It seeems to be there could be a
reason, which would interest me.

> In Actuality I finally decided to use Response.AddHeader "Expires", 0.


Fine with me.

> If you have anything of educational value to contribute then please do
> so.


Again, this is usenet, the OP cannot and should not limit the responses,
as you do not own the thread.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
catching browser navigation (prior to moving away) SpaceMarine ASP .Net 0 09-16-2008 10:33 PM
Disable the navigation buttons for IE navigation toolbar Laurahn ASP .Net 3 02-06-2007 04:17 AM
Re: disable backward navigation of the browser Steve C. Orr [MVP, MCSD] ASP .Net 1 03-07-2005 08:22 PM
Window.open interfering with browser navigation? Dan Cruz ASP General 2 01-19-2005 11:20 PM
Can IIS tell browser to redirect and replace in navigation history? Vince C. ASP General 1 03-05-2004 09:25 PM



Advertisments