passing variables problem in ASP.NET

  • Thread starter Thread starter hansen
  • Start date Start date
H

hansen

hi all,
I am creating online quiz (10 questions) with radio buttions (Yes/No). When
the user clicks on the submit button i do some calculation and based on that
calculation i display result.aspx page with the proper scors. so far so
good.
within the result.aspx page i have a link says "to view the proper answer
click here" (which will direct the user to another form called
correct.aspx)when clicked users will see the correct answers.

I have defined a class which holds all the boolean variables (v1,
v2,...v10). Anytime the user clicks on the wrong radio button within the
main page i set the proper boolean variable to true, so when i get to
correct.aspx page i want to output the rigth results based on my booleans...
example:
if(v1 = true) then
lblMain.text = "this is the proper result..."
elseif(v2 = true) then
lblMain.text = "whatever...."
....
end if
my problem is: i can't transfer the variable values to the third form
(correct.aspx) it will give FALSE value no matter what.
i have v1...v10 defined in a MainForm which is inherited by every single
form i am using.

anyone knows how to transfer the variables? what am i doing wrong? or whats
the correct way of doing this?

thanks a lot
 
Store the object in Session State...

SESSION("MyVariable") = WhateObjecvalues

Then, to get it.

Dim i as Integer = CType(Session("MyVariable"), ObjectType).FirstValue
 
thanks William,
I will give it a try :)

William Ryan said:
Store the object in Session State...

SESSION("MyVariable") = WhateObjecvalues

Then, to get it.

Dim i as Integer = CType(Session("MyVariable"), ObjectType).FirstValue
 
To be specific as to why the problem is probably occurring, the user may be
clicking just a plain hyperlink. When you do this, no form data gets
transferred to the other page.

An alternative to the session variables is ...
1) Dynamically construct the hyperlink so that it includes querystring
parameters for the information that you need.
2) Use the HyperLink class that might allow you to perform postback
operations when clicked.
 
Back
Top