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

Posted on 2011-10-24
Last Modified: 2012-05-12
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?

Question by:tcmmaxt
    LVL 11

    Expert Comment

    try this:
    <a href="javascript:window.history.back();">Go back to previous page</a>

    Author Comment

    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?
    LVL 11

    Accepted Solution

    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

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    This video discusses moving either the default database or any database to a new volume.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    732 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

    21 Experts available now in Live!

    Get 1:1 Help Now