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. image button event handler

image button event handler

Scheduled Pinned Locked Moved ASP.NET
sysadminquestion
3 Posts 3 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

    why is this so? when i click on the imgbtn, the whole tables is gone and display nothing. What should i do? Dim img As New ImageButton AddHandler img.Click, AddressOf ImageClickHandler img.ImageUrl = Server.MapPath("Pics\pencil.gif") Private Sub ImageClickHandler(ByVal sender As Object, ByVal e As ImageClickEventArgs) Session.Add("newdate", lblDate.Text) Dim dt As Date = CType(Session("newdate"), Date) Server.Transfer("LoginCalendarMakeBooking.aspx?BookingDate= " & dt & "ResourceName=" & name & "ResourceType=" & type) End Sub Anything wrong with this?

    J D 2 Replies Last reply
    0
    • T terjk

      why is this so? when i click on the imgbtn, the whole tables is gone and display nothing. What should i do? Dim img As New ImageButton AddHandler img.Click, AddressOf ImageClickHandler img.ImageUrl = Server.MapPath("Pics\pencil.gif") Private Sub ImageClickHandler(ByVal sender As Object, ByVal e As ImageClickEventArgs) Session.Add("newdate", lblDate.Text) Dim dt As Date = CType(Session("newdate"), Date) Server.Transfer("LoginCalendarMakeBooking.aspx?BookingDate= " & dt & "ResourceName=" & name & "ResourceType=" & type) End Sub Anything wrong with this?

      J Offline
      J Offline
      John Kuhn
      wrote on last edited by
      #2

      Nothing seems to be wrong -- if Server.Transfer() is the method you wish to use and LoginCalendarMakeBooking.aspx is the page you want to transfer to. What is that page supposed to do? Why would you use Server.Transfer as opposed to using Response.Redirect()? What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

      1 Reply Last reply
      0
      • T terjk

        why is this so? when i click on the imgbtn, the whole tables is gone and display nothing. What should i do? Dim img As New ImageButton AddHandler img.Click, AddressOf ImageClickHandler img.ImageUrl = Server.MapPath("Pics\pencil.gif") Private Sub ImageClickHandler(ByVal sender As Object, ByVal e As ImageClickEventArgs) Session.Add("newdate", lblDate.Text) Dim dt As Date = CType(Session("newdate"), Date) Server.Transfer("LoginCalendarMakeBooking.aspx?BookingDate= " & dt & "ResourceName=" & name & "ResourceType=" & type) End Sub Anything wrong with this?

        D Offline
        D Offline
        DFU23
        wrote on last edited by
        #3

        Most likely ... When doing the Server.Transfer it becomes the first request for the page (URL is different) and loses the ViewState because it is not a PostBack. Just my stab in the dark.

        Wally Atkins
        Newport News, VA, USA
        http://wallyatkins.com

        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