Solved

Response redirect after update

Posted on 2014-12-15
2
54 Views
Last Modified: 2014-12-16
I have the following code behind that I need to re-direct back to the previous page after update is submitted.     The code should have re-direct behavior similar to  a the button function "history.go(-1)".


protected void DetailsView2_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
    {
        Response.Redirect("~/      ");
0
Comment
Question by:BOEING39
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 40502590
You can't achieve that server-side without telling it what the previous page was.  Requests to the server are stateless so it doesn't get told anything about historical page views (unless your form submits to a different page, in which case you can get the previous page from the HttpReferer).

You're pretty much much with hard-coding the name of the page to redirect to; which isn't generally an issue unless you have multiple pages that all share your edit page.
0
 

Author Closing Comment

by:BOEING39
ID: 40503029
Quick response
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now