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

Expert:
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?


tcmmaxtAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jasonduanCommented:
try this:
<a href="javascript:window.history.back();">Go back to previous page</a>
0
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?
0
jasonduanCommented:
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);

}

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.