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 with session problem

Datagrid with session problem

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

    Hi I have a Datagrid and Button controls in a webform I am displaying Dept Details in Webform1.But when I click Button Then Entire Details should display in webform2 using sessions How? Thanks

    _ F 2 Replies Last reply
    0
    • S siddisagar

      Hi I have a Datagrid and Button controls in a webform I am displaying Dept Details in Webform1.But when I click Button Then Entire Details should display in webform2 using sessions How? Thanks

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      You can store the complete data in session and then you can bind your controls after getting the data from session in the second page.

      Best Regards, Apurva Kaushal

      S 1 Reply Last reply
      0
      • _ _AK_

        You can store the complete data in session and then you can bind your controls after getting the data from session in the second page.

        Best Regards, Apurva Kaushal

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

        Pls tell me How can i Do?

        N 1 Reply Last reply
        0
        • S siddisagar

          Pls tell me How can i Do?

          N Offline
          N Offline
          Naveed Kamboh
          wrote on last edited by
          #4

          Fetech complete data in a dataset and then pass that to a session variable, i guess it will work. Session["myData"]=DatSet

          Naveed Kamboh Complexity kills, Write easy code for your self. isolutionteam

          1 Reply Last reply
          0
          • S siddisagar

            Hi I have a Datagrid and Button controls in a webform I am displaying Dept Details in Webform1.But when I click Button Then Entire Details should display in webform2 using sessions How? Thanks

            F Offline
            F Offline
            faiqshah
            wrote on last edited by
            #5

            If the button is inside the datagrid then it is fairly easy. what you have to do is to hook the ItemCommand or RowCommand (in case you have Gridview). The following code may help you the CommandArgument property is inialized with the Id filed value in your table. you may then right the following code in RowCommand event protected void gw_RowCommand(object sender, GridViewCommandEventArgs e) { int ID = Convert.ToInt32(e.CommandArgument.ToString()); Session["ID"]=ID.ToString(); Response.redirect("http:detail.aspx"); } After the page is redirected to detail page there you should retrieve the ID value from the session as Integer Code=Convert.ToInt32(Session["ID"].ToString()); you can then use the Code to query your database and retrieve the datail best luck

            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