User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 374,011 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,768 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 980 | Replies: 8
Reply
Join Date: May 2008
Posts: 4
Reputation: thunderman is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
thunderman thunderman is offline Offline
Newbie Poster

passing seleced rows from gridview to another page

  #1  
May 20th, 2008
hello, I 'm still a noob at programming in vb.net
I have a little problem. I 'm trying to get my selected rows to another page. I already can select my rows with checkboxes but I don't know how I can pass them through a session to another page.
hopefully someone can help me.

greetz
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,122
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 46
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: passing seleced rows from gridview to another page

  #2  
May 20th, 2008
Hi there Thunderman and welcome to DaniWeb! Here is a great link where I believe you will find your answer:


Hope that helps you
Last edited by majestic0110 : May 20th, 2008 at 10:25 am.
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: May 2008
Posts: 4
Reputation: thunderman is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
thunderman thunderman is offline Offline
Newbie Poster

Re: passing seleced rows from gridview to another page

  #3  
May 20th, 2008
Originally Posted by majestic0110 View Post
Hi there Thunderman and welcome to DaniWeb! Here is a great link where I believe you will find your answer:



Hope that helps you

Hi majestic

I looked at the link you gave me, but they only discuss the way to pass the values through querystrings, but I like to pass my values through sessions, so I don't need to add something extra in my URL
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,122
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 46
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Veteran Poster

Re: passing seleced rows from gridview to another page

  #4  
May 20th, 2008
I think the second post on that link is what you need:

  1. Dim gridrow As GridViewRow = GridView1.SelectedRow
  2.  
  3. Session.Add("Value1", gridrow.Cells(0).Text)
  4.  
  5. Session.Add("Value2", gridrow.Cells(4).Text)
  6.  
  7. Response.Redirect("TestPage.aspx")
  8.  
  9. End Sub
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: May 2008
Posts: 4
Reputation: thunderman is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
thunderman thunderman is offline Offline
Newbie Poster

Re: passing seleced rows from gridview to another page

  #5  
May 21st, 2008
Originally Posted by majestic0110 View Post
I think the second post on that link is what you need:

  1. Dim gridrow As GridViewRow = GridView1.SelectedRow
  2.  
  3. Session.Add("Value1", gridrow.Cells(0).Text)
  4.  
  5. Session.Add("Value2", gridrow.Cells(4).Text)
  6.  
  7. Response.Redirect("TestPage.aspx")
  8.  
  9. End Sub


I 've tried your code you gave me, but I don't want to get one value at a time out of my gridview. My problem is, I select multiple rows with my checkbox and I want to get the selected rows in on time and pass them to another page.
Reply With Quote  
Join Date: May 2008
Posts: 10
Reputation: Shubhib is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Shubhib Shubhib is offline Offline
Newbie Poster

Re: passing seleced rows from gridview to another page

  #6  
May 27th, 2008
hi sir, u had sent the code for sending the values to other form but u didn't mention where to pass these values in gridview form. please help me
Reply With Quote  
Join Date: May 2008
Posts: 4
Reputation: thunderman is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
thunderman thunderman is offline Offline
Newbie Poster

Re: passing seleced rows from gridview to another page

  #7  
May 27th, 2008
I want to past my selected rows from my firstpage.aspx to a secondpage.aspx. I already got the code to put my values in an array and send the array to my secondpage.aspx with an session but I can't get the values out of my array on the secondpage.aspx. I get an error: nullreferenceexception was unhandled by user code.
This is my code I use on my secondpage.aspx to get the values out of my array and try to put them into a table.
  1. 'variabelen in tabel inlezen
  2. Dim hshToestel As Hashtable
  3. hshToestel = Session("Reservatie")
  4. For Each oToestel As clstblToestellen In hshToestel
  5. Dim tr As New TableRow
  6. tr.Cells.Add(oToestel.fnSelect)
  7. tblReservatie.Rows.Add(tr)
  8. Next
Last edited by peter_budo : May 31st, 2008 at 6:54 am. Reason: Use [code=langauage] not <code = langauge> without spaces in tag
Reply With Quote  
Join Date: May 2008
Posts: 10
Reputation: Shubhib is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Shubhib Shubhib is offline Offline
Newbie Poster

Re: passing seleced rows from gridview to another page

  #8  
31 Days Ago
hi thunderman,
i think i'm facing the same prob now as u're facing in this. please tell me how to select values from gidview on selection of multiple checkboxes. i want to manipulate multiple values at the same time.
Reply With Quote  
Join Date: Apr 2007
Posts: 177
Reputation: greeny_1984 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 6
greeny_1984 greeny_1984 is offline Offline
Junior Poster

Re: passing seleced rows from gridview to another page

  #9  
31 Days Ago
hi u can use row command event to achieve this functionality.
when ever u click on a checkbox,this event gets fired.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 10:52 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC