views:

59

answers:

3

I have a page (page1) with a LinkButton that, when clicked, will take the browser to a new page (page2).

When I click the LinkButton page1 posts back and hits the Init and Load event handlers for page1, and then moves on to page2.

How can I tell in the page1 postback that I am about to be taken to a new page, as opposed to clicking a Button that causes the page posts back but does not navigate away?

A: 

You question is not clear, can you please add some more evidence to make you point clear so that it can be answered ?

Bootcamp
you were correct as well, my question did not have enough information. Sorry about that.
RobRolls
A: 

It appears that you're not using the OnCLick event of the LinkButton, If you use the event, perform the action of the click there, not on the Page Load event?

Mark Redman
A: 

You can also add OnClick events to your code behind for each button, and in the case of the one that is to postback to another page, do a Response.Redirect. The limitation of that however is that if you need form data on "page2", you will lose posted form data on a Response.Redirect.

jaywon