<font size="3">Morning all.</font>
<font size="3"> </font>
<font size="3">First Ill start with a bit of detail about my problem:</font>
<font size="3">I have a web page which is viewable in 4 languages and shows different products depending on what country you are in.</font>
<font size="3">Your country is determined by you when you first get to the site there is a home page which you select your country on, this then sets a session variable (countryID) and redirects you to the first proper page. This all works and has done for over a year with no problems.</font>
<font size="3"> </font>
<font size="3">The issue now is that the client has requested functionality so that when you carry out a search for a product, if it is not available in the country that you are currently viewing a message comes up saying:</font>
<font size="3">“Sorry no products could be found for [country name], however products have been located in the following locations…” You are then presented with a link that takes you to the search results pages for the country that has the products that you searched for.</font>
<font size="3">It does this by doing the following:</font>
<font size="3">1.</font> <font size="3">Create a new session variable called PrevCountryID and set it to the current countryID</font>
<font size="3">2.</font> <font size="3">Change the current countryID (Session Var) to be the countryID of the country where the products are located.</font>
<font size="3">3.</font> <font size="3">Redirect you to search results.aspx.</font>
<font size="3"> </font>
<font size="3">You are then presented with the search results and you are browsing the (for example) Spanish site.</font>
<font size="3"> </font>
<font size="3">This is all fine.</font>
<font size="3"> </font>
<font size="3">The problem comes when the user does the following: Clicks the Back button.</font>
<font size="3"> </font>
<font size="3">As the previous page is cached the browser does not post back to the server so although the page that they are on has all of the (for example) UK branding the session variable is still set to spain (For example). This results in the next link that the user click on to redirect them to the Spanish site again…</font>
<font size="3"> </font>
<font size="3">There is code on the home page and the search page so that if you land on them and your previous country is not null and not == current country id your current country ID is reset to match your previous countryID, This works but only if you refresh the page after pressing back (to force a post back to the server)</font>
<font size="3"> </font>
<font size="3">I am pulling my hair out over this one, I have tried using ajax to trigger a server side event when the page loads – at first I thought that this was all working great, then realised that the method that is invoked by the ajax call cannot access the session variables for the user…</font>
<font size="3"> </font>
<font size="3">HELP!!!</font>