Showing posts with label dimensional. Show all posts
Showing posts with label dimensional. Show all posts

Wednesday, March 21, 2012

Passing a value from a class method to a function in start page and back to class


Hi,
I have an a one dimensional generated in one of the function of a class which I developed. I need to know how to perform the following:
1) Pass the value to the start page from the class method (this part is done).
2) Pass the value back again to another method of the same class from the start page.

Sounds like you'll need some kind of event to fire from the start page like a button click or a javascript event like a onmouseover or some other trigger to initiate the pass. What are you trying to do exactly?

Friday, March 16, 2012

Passing an array as a session variable

I have 2 asp.net forms. In the first form I create a one dimensional array and copy that array into a session object. In the second form I want to read the elements of that array. Everything I've tried results in either a casting error, a late binding error or nothing at all. The following code shows what Iwant to do.

Form one: Dim aArray(2) as stringaArray(0) = "zero"aArray(1) = "one"Session("PassArray") = aArray
Form two: Dim aTest(2) as stringaTest(0) = CType(Session("PassArray(0)"), String)aTest(1) = CType(Session("PassArray(1)"), String)When I run form two in the editor, I can Watch Session("PassArray") and see:Session("PassArray") {System.Array} object-- (0) "zero" string-- (1) "one" stringSo I know it's there and available, but how do I read the extents.

Could really use a simple code example to explain what I'm doing wrong.

Hi,

Use this on the second form:

Dim aTest() As String = CType(Session("PassArray"), String())


That did it. Thank you.