473,385 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

passing variables problem in ASP.NET

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
Jul 21 '05 #1
4 1477
Store the object in Session State...

SESSION("MyVariable") = WhateObjecvalues

Then, to get it.

Dim i as Integer = CType(Session("MyVariable"), ObjectType).FirstValue
"hansen" <as*****@hotmail.com> wrote in message
news:e3**************@TK2MSFTNGP10.phx.gbl...
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

Jul 21 '05 #2
thanks William,
I will give it a try :)

"William Ryan" <do********@nospam.comcast.net> wrote in message
news:OI**************@TK2MSFTNGP12.phx.gbl...
Store the object in Session State...

SESSION("MyVariable") = WhateObjecvalues

Then, to get it.

Dim i as Integer = CType(Session("MyVariable"), ObjectType).FirstValue
"hansen" <as*****@hotmail.com> wrote in message
news:e3**************@TK2MSFTNGP10.phx.gbl...
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


Jul 21 '05 #3
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.
"William Ryan" <do********@nospam.comcast.net> wrote in message
news:OI**************@TK2MSFTNGP12.phx.gbl...
Store the object in Session State...

SESSION("MyVariable") = WhateObjecvalues

Then, to get it.

Dim i as Integer = CType(Session("MyVariable"), ObjectType).FirstValue
"hansen" <as*****@hotmail.com> wrote in message
news:e3**************@TK2MSFTNGP10.phx.gbl...
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


Jul 21 '05 #4
Actually I think that the LinkButton does postbacks.

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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.
"William Ryan" <do********@nospam.comcast.net> wrote in message
news:OI**************@TK2MSFTNGP12.phx.gbl...
Store the object in Session State...

SESSION("MyVariable") = WhateObjecvalues

Then, to get it.

Dim i as Integer = CType(Session("MyVariable"), ObjectType).FirstValue
"hansen" <as*****@hotmail.com> wrote in message
news:e3**************@TK2MSFTNGP10.phx.gbl...
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



Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Amr Mostafa | last post by:
Hello :) I'm trying to write a script that deals with a web service. I'm using NuSoap class. my question is : Can I pass some variables By Reference to the web service and get the result back...
4
by: Jason Us | last post by:
Does anyone have experience with passing variables from an ASP page to a JSP page. The way it currently works in passing the SSN in the URL. This cannot be good. I thought that storing a...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
5
by: Jack | last post by:
Hi, I need to pass multple variables in a link in order to go to a asp page with the two varables. The following are the values of the variables using response.write: <%'Response.Write Mypage...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
20
by: Gregory Piñero | last post by:
Hey guys, would someone mind giving me a quick rundown of how references work in Python when passing arguments into functions? The code below should highlight my specific confusion: <code> ...
6
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
3
by: Lee | last post by:
Hi All How can I pass options from one webpage into another webpage. When the user clicks on the hyperlink I want them to be go to the next page but I need to pass in a number that the next...
12
by: Andrew Bullock | last post by:
Hi, I have two classes, A and B, B takes an A as an argument in its constructor: A a1 = new A(); B b = new B(a1);
6
BezerkRogue
by: BezerkRogue | last post by:
This is the most fundamental action I am sure, but I can't seem to make it happen. I am familiar with passing variables in ASP. But that doesn't seem to be the preferred method in .NET. I have...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.