Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. imagebutton event handler

imagebutton event handler

Scheduled Pinned Locked Moved ASP.NET
sysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    terjk
    wrote on last edited by
    #1

    i tried using response.redirect instead of server.trnasfer but i still culdn't get the result i want. instead the web form refreshes. Without displaying the image button again. How should i do when add an event handler to an image button if i code it programtically. thanx

    J 1 Reply Last reply
    0
    • T terjk

      i tried using response.redirect instead of server.trnasfer but i still culdn't get the result i want. instead the web form refreshes. Without displaying the image button again. How should i do when add an event handler to an image button if i code it programtically. thanx

      J Offline
      J Offline
      Jason Weibel
      wrote on last edited by
      #2

      Here is some old code I grabbed that used an image button with a redirect. ''// ASPX Page <asp:imagebutton id="ibtnCheck" runat="server" ImageUrl="../images/OK2.gif" Visible="True"></asp:imagebutton>  ''// Code Behind Page Protected WithEvents ibtnCheck As System.Web.UI.WebControls.ImageButton Public Sub ibtnCheck_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibtnCheck.Click HttpContext.Current.Response.Redirect("NewPage.aspx") End Sub Note I said old code because using response.redirect is very bad on performance. Thus I have replaced the above code with the following: ''// ASPX Page <asp:hyperlink id="lbtnCheck" runat="server" ImageUrl=../images/OK2.gif></asp:hyperlink> ''// Code Behind Page Protected WithEvents lbtnCheck As System.Web.UI.WebControls.HyperLink lbtnCheck.NavigateUrl = "NewPage.aspx" Hope this is helpful. Jason W.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups