ASP.NET - Find the control in the previous page which caused navigation

Asked By Hemanth Kumar on 05-Sep-13 08:25 AM
Hi,

I have Imagebutton in first page as follows. Now in the 'SearchResults.aspx" page, i shoud have a if condition such that the condition shoud test whether the navigatios is through imagebutton control or not.Can someone help ?

<asp:ImageButton ID="btnSearchJob" runat="server" ImageUrl="assets/images/buttons/search_jobs_off.gif"

          PostBackUrl="SearchResults.aspx" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(this.id,'','assets/images/buttons/search_jobs_on.gif',1)" 

Robbe Morris replied to Hemanth Kumar on 05-Sep-13 09:36 AM
You'll want to do away with PostBackUrl and set up a on click handler.  In the event you can do whatever you want with the url knowing that it came from this specific imagebutton.