If I select a value I'm redirected to another page. I come back using
the browser's back button, and the option is still selected. So far so
good. But the very weird thing is that if I look at the source code :
<option selected="selected" value="13808">DataPage6</option>
<option value="13805">DataPage5</option>
<option value="13489">DataPage4</option>
and yet, I've got the second item (DataPage5) selected in the list.
So what's going on there ????
Thanks for helping.
Sam
Would you make it bit clear .. what is actual problem....
What you want?
What is happening?
Thanks..
"sam" <samuelb...@googlemail.com> wrote in message
news:1141732039.9...@i39g2000cwa.googlegroups.com...
In the load event:
If Not IsPostBack Then
'get data from database and bind dropdownlist
End If
in the selectedindexchanged event handler:
Public Sub OnSelectedIndexChanged(ByVal sender As Object, ByVal e As
EventArgs)
Dim q As New Query(CType(sender,
DropDownList).SelectedItem.Text, CInt(CType(sender,
DropDownList).SelectedItem.Value))
Session("CurrentQuery") = q
Response.Redirect("Flow.aspx")
End Sub
Then when I browse back from Flow.aspx to my page, the selecteditem in
dropdownlist is still the one I had selected, which is expected, BUT
the html code if I do 'View Source' is:
<option selected="selected" value="13808">DataPage6</option>
<option value="13805">DataPage5</option>
<option value="13489">DataPage4</option>
even if the selecteditem is DataPage5 or DataPage4. It doesn't make
sense to me.
Can you help ?
Eliyahu
"sam" <samuelb...@googlemail.com> wrote in message
news:1141732039.9...@i39g2000cwa.googlegroups.com...
"back button" reload page asp.net
you will find a lot of suggestions.
Eliyahu
"sam" <samuelb...@googlemail.com> wrote in message
news:1141737477.7...@j52g2000cwj.googlegroups.com...
the only way i found on the web is to disable caching, but this is
quite inefficient. I'm quite amazed that there is no simple way to
achieve what I want, without making any compromises such as disabling
caching.
That's the whole point! You are dealing with the following scenario:
1. User loads the page from the server. This selects the option specified in
the code.
2. User makes another option selected.
3. User moves out from the page. The page remains cached in the browser
cache with the option selected by the user.
4. User hits the "Back" button. The browsers gets the page from the browser
cache with the option selected by the user. It DOES NOT load the page from
the server.
Eliyahu
Eliyahu
"sam" <samuelb...@googlemail.com> wrote in message
news:1141742958.3...@u72g2000cwu.googlegroups.com...
1. user select a value
2. postback
3. selectedindexchanged event handler called
4. user redirected
5. user browses back to the page.
On 5. the page is loaded from cache, i agree. But to me it is clear
that the page in cache should be the one that was created in 2. and it
should know about the new selected index.
If not, and if the only way to achieve what i want is through forcing
reloading by not caching the page, then can you help me for that ? I've
tried the following code to force expiration of the page, but it only
works with IE, it does not work with Mozilla or Netscape :
<%
Response.CacheControl = "no-cache"
Response.AddHeader("Pragma", "no-cache")
Response.ExpiresAbsolute = DateTime.Now.Date
Response.Expires = -1
%>
I can't advice you on other browsers. So far I have being blessed with the
customers who are happy with IE only. Ask this question in a separate
thread.
Eliyahu
"sam" <samuelb...@googlemail.com> wrote in message
news:1141744273.7...@p10g2000cwp.googlegroups.com...
Just a simple Response.Redirect("anotherpage.aspx") in the
SelectedIndexChanged event handler of my dropdownlist.
>I can't advice you on other browsers. So far I have being blessed with the
>customers who are happy with IE only. Ask this question in a separate
>thread.
lucky you...
This means the browser gets sent an HTTP header with a redirect
instruction and no body rather than "the page that was created at step
2." No HTML was ever rendered and sent to the browser at all, just the
redirect header.
>But here's my understanding:
> 1. user select a value
> 2. postback
> 3. selectedindexchanged event handler called
> 4. user redirected
> 5. user browses back to the page.
> On 5. the page is loaded from cache, i agree. But to me it is clear
> that the page in cache should be the one that was created in 2. and it
> should know about the new selected index.