Solved

Response redirect after update

Posted on 2014-12-15
2
57 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

829 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