?
Solved

Response redirect after update

Posted on 2014-12-15
2
Medium Priority
?
61 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month9 days, 2 hours left to enroll

765 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