[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Response redirect after update

Posted on 2014-12-15
2
Medium Priority
?
63 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

873 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