Click to See Complete Forum and Search --> : Running a Page based on a Click


George1111
March 10th, 2008, 06:56 AM
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



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

George1111
March 10th, 2008, 07:48 AM
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

nelo
March 13th, 2008, 11:54 AM
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... :)