CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    1,901

    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

  2. #2
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    1,901

    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

  3. #3
    Join Date
    Nov 2002
    Location
    .NET 3.5 VS2008
    Posts
    1,039

    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured