Running a Page based on a Click
USING VS2005 ASP.NET
I have an ImageButton, which needs to launch a page when clicked
(Probably the most basic question there is but I dont even know where to start to get help on a question like this)
Here is the click event with link
Code:
Protected Sub ImageButton1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
http://localhost/picking1/default.asp
End Sub
Appreciate any help
Re: Running a Page based on a Click
I put the link into the PostBackUrl property and it now works
This is not how it should be done, I'm sure, but having scoured 30-40 sites trying to find the solution, this is the best I can come up with
I would like to know the .NET elegant proper approach in case I need to do something weird like run and EXE from a click
Thanks
Re: Running a Page based on a Click
The PostBackUrl is the recommended approach if you simply want to redirect the user to another web page when the image button is clicked. If you want to run an exe from the handler for the click event you'll probably have to do a bit extra... :)