Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

How to clear postbacks from window.history?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cashdeskmac - 14 Dec 2007 13:21 GMT
Hi,

Is it possible to clear the recent history so that a link with the href
"javascript:window.history.back()" doesn't record any postbacks?

For example, if I the user makes a few selections on a page and clicks the
Back link, I want them to go to the previous page rather than going to the
previous state of the page.

Any help is appreciated as always.
andrew.douglas11@gmail.com - 14 Dec 2007 18:17 GMT
One way that you could solve your problem is to use the AJAX
Extensions.  After you install the AJAX Extensions, if you put content
inside of an UpdatePanel control, and the user clicks something inside
it, a PostBack will still occur, but only the portion of the screen
contained in the UpdatePanel will be refreshed after the PostBack.  So
if you click the Back button, it will act as if the PostBack never
happened.  Here's some code for you:

           <asp:UpdatePanel ID="UpdatePanel1" runat="server">
           <ContentTemplate>
               <asp:Label ID="lblTime" runat="server"></asp:Label>
               <asp:Button ID="btnRefreshUpdatePanel" runat="server"
Text="Do PostBack" />
           </ContentTemplate>
           </asp:UpdatePanel>

If you have a page foo.html that links to a page foo.aspx which
contains the above UpdatePanel, the user can click the "Do PostBack"
button as many times as they want, and you can still press the
browser's Back button to get back to foo.html.

Hope this helps
Andy

On Dec 14, 8:21 am, cashdeskmac
<cashdesk...@discussions.microsoft.com> wrote:
> Hi,
>
[quoted text clipped - 6 lines]
>
> Any help is appreciated as always.
cashdeskmac - 14 Dec 2007 18:44 GMT
Fantastic.  Thank you very much. :-)

> One way that you could solve your problem is to use the AJAX
> Extensions.  After you install the AJAX Extensions, if you put content
[quoted text clipped - 32 lines]
> >
> > Any help is appreciated as always.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.