CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Saving grid values to session variables

Print topic Send  topic

Author Message
gpdeering

Posts: 57
Posted: 04/24/2006, 12:49 PM

I've decided that the best way to access the field values in a grid (Repeater) is to save them to a session variable as the grid is being generated in the filename.aspx.vb file.

I believe I'm correct when I say that the grid values are generated by

Protected Sub gridnameItemDataBound()

So, assuming I'm correct here, how do I go about saving each value of a field to an array, then copying that array into session variable?

So far, I'm trying to use the syntax:
localArray(gridnameCurrentRowNumber) = gridnamefieldname.Text

Then, I create a new string variable and concatentate each of the array elements together into the new variable. Then, the variable gets copied into a session variable.

Is this the right way to do it?

Thanks,

--Glen
View profile  Send private message
Diesel

Posts: 43
Posted: 04/26/2006, 3:57 AM

You do not need to use an array

Just build your array into your Session variable like this:
Add the following code in the Before Show Row event of your Grid

If System.Web.HttpContect.Current.Session("MyValues") = "" Then
System.Web.HttpContect.Current.Session("MyValues")=gridnamefieldname.text
Else
System.Web.HttpContect.Current.Session("MyValues") = System.Web.HttpContect.Current.Session("MyValues") & "," & gridnamefieldname.text

Regards
View profile  Send private message
gpdeering

Posts: 57
Posted: 04/26/2006, 12:57 PM

Excellent idea! That's so simple, it's bound to work! I'll let you know how it turns out.

Thanks again!


--Glen
View profile  Send private message
gpdeering

Posts: 57
Posted: 04/27/2006, 5:53 AM

YEAH!!!!

Thanks to your (embarrassingly) simple suggestion, I finally got over the hump! I'm in the final stretch with this project now.

Thanks, Diesel!!!
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.