• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 563
  • Last Modified:

how do you return or point back to .net asp C# grid view table

I have a asp .net grid view C# that gets loaded with a list of items  based on a search by user from another web form in same application. Once the user clicks on one of the items in the grid view the system directs them to another web form page.  The user would like to be able to return back to the  gridview page if what they selected is not what they want without  using the back button on the browser and use a new link instead. Could some one show me  sample C# code how to do this?

  • 2
1 Solution
try this:
<a href="javascript:window.history.back();">Go back to previous page</a>
tcmmaxtAuthor Commented:
thank you looks good. they prefer to point back to previous page using  C#  code behind code, somehow maybe capturing the url that got them to this other page and point back?
you can use Page.ClientScript.RegisterStartupScript() Method

protected void xxx_Clicked(object sender, EventArgs e)
   string js = "window.history.back();";
   Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript",   js , rue);



Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now