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. LinkButton in GridView

LinkButton in GridView

Scheduled Pinned Locked Moved ASP.NET
5 Posts 4 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.
  • A Offline
    A Offline
    AS 13
    wrote on last edited by
    #1

    Hello Everybody, I have GridView like below: Name CustomerID Send Rakesh 01234 Send In this "Send" is a LinkButton. I need to develope it like when a user click on "Send", page should be redirect to a different page and value of "CustomerID" should go to the redirect page like Querystring. Thanks in Advance Happy Coding

    A key to every Solution

    R N B 3 Replies Last reply
    0
    • A AS 13

      Hello Everybody, I have GridView like below: Name CustomerID Send Rakesh 01234 Send In this "Send" is a LinkButton. I need to develope it like when a user click on "Send", page should be redirect to a different page and value of "CustomerID" should go to the redirect page like Querystring. Thanks in Advance Happy Coding

      A key to every Solution

      R Offline
      R Offline
      R Palanivel
      wrote on last edited by
      #2

      Set your Link button's PostBackUrl into your redirect Page. Get the CustomerId value By "PreviousPage" object

      r_palanivel83 10:01 4 Jan '06

      A 1 Reply Last reply
      0
      • R R Palanivel

        Set your Link button's PostBackUrl into your redirect Page. Get the CustomerId value By "PreviousPage" object

        r_palanivel83 10:01 4 Jan '06

        A Offline
        A Offline
        AS 13
        wrote on last edited by
        #3

        Thanks for reply. But how can I get the CustomerID value from PreviousPage Object. That value should be the particular row value where the LinkButton is clicked. plz if possible give me a sample. Happy Coding

        A key to every Solution

        1 Reply Last reply
        0
        • A AS 13

          Hello Everybody, I have GridView like below: Name CustomerID Send Rakesh 01234 Send In this "Send" is a LinkButton. I need to develope it like when a user click on "Send", page should be redirect to a different page and value of "CustomerID" should go to the redirect page like Querystring. Thanks in Advance Happy Coding

          A key to every Solution

          N Offline
          N Offline
          Nouman Bhatti
          wrote on last edited by
          #4

          add onclick event for send button and calls a method written in code file in that method just write Response.Redirect("secondpage.aspx?"id) // id is the customerid passed from .aspx page for example (.aspx file) OnClick='<%# GetCommentURL(Eval("ArticleID").ToString()) %>' (.cs file) protected string GetCommentURL(string id) { return "Comments.aspx?id=" + id; }

          modified on Tuesday, January 29, 2008 3:01:18 AM

          1 Reply Last reply
          0
          • A AS 13

            Hello Everybody, I have GridView like below: Name CustomerID Send Rakesh 01234 Send In this "Send" is a LinkButton. I need to develope it like when a user click on "Send", page should be redirect to a different page and value of "CustomerID" should go to the redirect page like Querystring. Thanks in Advance Happy Coding

            A key to every Solution

            B Offline
            B Offline
            bokuceres
            wrote on last edited by
            #5

            why don't you set linkbutton.commandargument = customerid in itemdatabound/rowdatabound eventhandler then set linkbutton.commandname = "send" in property page then add itemcommand/rowcommand eventhandler in this handler add this code

            if (e.commandname == "send")
            {
            DoWhatYouWantToDo(e.commandargument);
            }

            i hope it helps

            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