Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a datagrid in session

Status
Not open for further replies.

chix001

IS-IT--Management
Oct 24, 2001
24
0
0
US
Hi everyone!

I have a datagrid on one page that I need to use on another page (sort of a printer friendly thing), and the way that I would like to do this is to pass the actual datagrid in session, redirect to the new page and retrieve it from there. Seems simple...

When I retrieve the datagrid from session in the new page, I bind it to a datagrid control that is on the page. I can step through with no errors, but the datagrid WILL NOT SHOW. I cannot figure out what I'm doing wrong.

Here's the code I'm using (VB.NET syntax):

dgrdReport = CType(Session("Report"), DataGrid)
lblTitle.Text = CType(Session("Title"), String)
dgrdReport.DataBind()
dgrdReport.Visible = True

As info - the title part works, but it's passing a string and not an entire control.

Thanks for any help you can give,
CHIX001
 
Have you tried putting the Session into a datatable and then binding the datatable to the datagrid

 
Hi IndyGill:

Thanks - I thought that I had tried that first, but apparently not - it worked like a charm!

Have a great day!

CHIX001
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top