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. Datagrid Link Button

Datagrid Link Button

Scheduled Pinned Locked Moved ASP.NET
question
5 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.
  • S Offline
    S Offline
    Shajeel
    wrote on last edited by
    #1

    I am using ItemDataBound event to add a Link button to a column using following code

    					LinkButton temp = new LinkButton();
    					temp.Click += new EventHandler(xyz);
    					temp.ID = e.Item.Cells\[i\].Text;
    					temp.CommandArgument = e.Item.Cells\[i\].Text;
    					temp.Text = e.Item.Cells\[i\].Text;
    

    now when page is displayed i see these buttons but when i click on them, page is refreshed but Click event is not raised. how can i see which event control and which event is raised when i am clicking this link.

    Regards Shajeel

    S 1 Reply Last reply
    0
    • S Shajeel

      I am using ItemDataBound event to add a Link button to a column using following code

      					LinkButton temp = new LinkButton();
      					temp.Click += new EventHandler(xyz);
      					temp.ID = e.Item.Cells\[i\].Text;
      					temp.CommandArgument = e.Item.Cells\[i\].Text;
      					temp.Text = e.Item.Cells\[i\].Text;
      

      now when page is displayed i see these buttons but when i click on them, page is refreshed but Click event is not raised. how can i see which event control and which event is raised when i am clicking this link.

      Regards Shajeel

      S Offline
      S Offline
      sepel
      wrote on last edited by
      #2

      when u click it only page_load raised. i think that you'r plused event is null or empty. if u add your event in page load each time there will be right.

      sepel

      S 1 Reply Last reply
      0
      • S sepel

        when u click it only page_load raised. i think that you'r plused event is null or empty. if u add your event in page load each time there will be right.

        sepel

        S Offline
        S Offline
        Shajeel
        wrote on last edited by
        #3

        no its not null, i have a break point int the function but it is not fired.

        Regards Shajeel

        S 1 Reply Last reply
        0
        • S Shajeel

          no its not null, i have a break point int the function but it is not fired.

          Regards Shajeel

          S Offline
          S Offline
          sepel
          wrote on last edited by
          #4

          yes it raised but only page load is raised itrace some problem. i add javascript to my buttons. i hope u siolve it.

          sepel

          S 1 Reply Last reply
          0
          • S sepel

            yes it raised but only page load is raised itrace some problem. i add javascript to my buttons. i hope u siolve it.

            sepel

            S Offline
            S Offline
            Shajeel
            wrote on last edited by
            #5

            but i want to raise event for function xyz. post back is working but my code is in xyz.

            Regards Shajeel

            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