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. pass a variable in hyperlink gridview using code behind

pass a variable in hyperlink gridview using code behind

Scheduled Pinned Locked Moved ASP.NET
questiondatabase
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.
  • R Offline
    R Offline
    raghvendrapanda
    wrote on last edited by
    #1

    Hy, I have created a hyperlink in a gridview in code behind...how can i pass a variable in the hyperlink in code behind.... my code is HyperLinkField hfield = new HyperLinkField(); hfield.HeaderText = "memberid"; hfield.NavigateUrl = "Default.aspx?query={0}" ; hfield.DataTextField = dt.Columns[0].ToString(); GridView1.Columns.Add(hfield); GridView1.DataSource = dt; GridView1.DataBind(); Regards

    B D 2 Replies Last reply
    0
    • R raghvendrapanda

      Hy, I have created a hyperlink in a gridview in code behind...how can i pass a variable in the hyperlink in code behind.... my code is HyperLinkField hfield = new HyperLinkField(); hfield.HeaderText = "memberid"; hfield.NavigateUrl = "Default.aspx?query={0}" ; hfield.DataTextField = dt.Columns[0].ToString(); GridView1.Columns.Add(hfield); GridView1.DataSource = dt; GridView1.DataBind(); Regards

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      when you want to pass the variable?Can you tell us the exact scenario?

      Cheers!! Brij

      1 Reply Last reply
      0
      • R raghvendrapanda

        Hy, I have created a hyperlink in a gridview in code behind...how can i pass a variable in the hyperlink in code behind.... my code is HyperLinkField hfield = new HyperLinkField(); hfield.HeaderText = "memberid"; hfield.NavigateUrl = "Default.aspx?query={0}" ; hfield.DataTextField = dt.Columns[0].ToString(); GridView1.Columns.Add(hfield); GridView1.DataSource = dt; GridView1.DataBind(); Regards

        D Offline
        D Offline
        Dominic Goulet
        wrote on last edited by
        #3

        You need to use the attributes already in place for that!

        ______________________ Dominic Goulet FroggedSoft

        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