i am using ASP.NET 2008 for my application with IE-7 browser..but browsers back button does not reflect on previous page on single click.. it reflect on previous page on double click.. plz reply me how to make it in single click? i m using process bar at the time of processing..
back button of browser compitible with asp.net application
Collapse
X
-
Tags: None
-
Please rephrase your question.
I do not understand what you mean when you are referring to "single click" and "double click".
Please remember that when the user clicks the web browser's back button it displays a cached version of your web page.
This means that if your user preformed a "double click" (??) that displayed something client side this would be cached by the web browser. If the user hits the back button, this cached version of the page will be displayed.
Look into using meta tags to control how your page is cached in the browser....look into setting your page's content to expire as soon as it's displayed...loo k into setting the no-cache tag
eg:
You should research the topic of browser caching to better understand how to implement the best solution for your application.Code:<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE, must-revalidate, max-age=0"> <meta http-equiv="expires" content="0"> <meta http-equiv="Pragma" content="no-cache">
-
if i double click on back button then page will back on previous page... but it's not happening on single click...
i want to go back in single click...?Comment
-
no .. i d'nt have any back button.. i am talking about the browser back button .. and i want to go back on previous page on single hit on browser back button..?Comment
-
Ok I know what's happening.
You have an aspx page and the user does stuff on it. The page does a full page submit to the server, and the previous version of the page is stored in the browser's history. So, when you hit the back button you will see one of these pages.
To get around this you can wrap your page's content in an UpdatePanel. Then the page will do an asynchronous post back to the server instead of a full page post back. Thus, page's history will not be stored in the browser's history and you will be returned to the previous page with "one click of the back button".
(Please note that the UpdatePanel requires a ScriptManager to be on the page in order to work)
-FrinnyComment
-
thanx.. but i am using asp.net application,, does not using ajax in our application... plz tell me with example how to use update panel and script manager..?Comment
-
-
i think .. this is not the problem of browser caching...if it is the issue of caching ,, then why it navigate back on double click on back button.. i am using master page in my application because of that it takes twice hit to go back on previous page first for master and second for content page,........ plz tell me how to navigate on previous page in single click... i am working visual studio 2008......Comment
-
You aren't making sense, a MasterPage is compiled along with a Content Page in order to create a whole web page. Why would you only be shown the MasterPage when hitting the back button???
The browser's back button controls web pages that the browser has cached in it's history. If you have to hit the browser's back button twice that means that the web page has been cached in the browser's history two times....this is an indication that the user has made a page submit 2 times to the server.
Since you are using Visual Studio 2008, you should have an UpdatePanel control available to you in your ToolBox (in the AJAX Extensions section).
If you don't want your page to cache in the browser's history, then wrap your page's content in an UpdatePanel....
Any content in the UpdatePanel will cause a partial page update (preform an asynchronous call to the server). This means that only a portion of the page will be updated...in your case, all of your page's content will be refreshed during the partial page update. Since there is no full page postbacks happening, nothing will be stored in the browser's history when the user is using your page.
You could wrap your content in an UpdatePanel on each page or could do this in your MasterPage:
Code:<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="MasterPage.Master.vb" Inherits="Mynamespace.Master" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" style="height:95%;width:97%;"> <head Id="Head1" runat="server"> <title></title> </head> <body> <form ID="Form1" runat="server"> <asp:ScriptManager Id="MyScriptManagerInstance" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="MyUpdatePanel"> <ContentTemplate> <asp:contentplaceholder Id="PageContent" runat="server"> </asp:contentplaceholder> </ContentTemplate> </asp:UpdatePanel> </form> </body> </html>Comment
-
if i make a button on my page like that...
it takes two click to navigate back...Code:<input type="button" value=" <-- BACK " onclick="history.go(-1);return false;" />
if i am using
then it goes back in single click..... is there any coding or setting for so this can apply for browser back button....Code:<input type="button" value=" <-- BACK " onclick="history.go(-2);return false;" />
Last edited by Frinavale; Mar 19 '09, 03:03 PM. Reason: Added [code] tags. Please post code in [code] [/code] tags.Comment
-
when i put asp:ScriptManag er in my master page it is giving me error that
ScriptManager is a unkown tag...????Comment
Comment