473,661 Members | 2,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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)wh en 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 1497
Store the object in Session State...

SESSION("MyVari able") = WhateObjecvalue s

Then, to get it.

Dim i as Integer = CType(Session(" MyVariable"), ObjectType).Fir stValue
"hansen" <as*****@hotmai l.com> wrote in message
news:e3******** ******@TK2MSFTN GP10.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)wh en 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********@nos pam.comcast.net > wrote in message
news:OI******** ******@TK2MSFTN GP12.phx.gbl...
Store the object in Session State...

SESSION("MyVari able") = WhateObjecvalue s

Then, to get it.

Dim i as Integer = CType(Session(" MyVariable"), ObjectType).Fir stValue
"hansen" <as*****@hotmai l.com> wrote in message
news:e3******** ******@TK2MSFTN GP10.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)wh en 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********@nos pam.comcast.net > wrote in message
news:OI******** ******@TK2MSFTN GP12.phx.gbl...
Store the object in Session State...

SESSION("MyVari able") = WhateObjecvalue s

Then, to get it.

Dim i as Integer = CType(Session(" MyVariable"), ObjectType).Fir stValue
"hansen" <as*****@hotmai l.com> wrote in message
news:e3******** ******@TK2MSFTN GP10.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)wh en 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.r illing.net> wrote in message
news:%2******** ********@TK2MSF TNGP09.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********@nos pam.comcast.net > wrote in message
news:OI******** ******@TK2MSFTN GP12.phx.gbl...
Store the object in Session State...

SESSION("MyVari able") = WhateObjecvalue s

Then, to get it.

Dim i as Integer = CType(Session(" MyVariable"), ObjectType).Fir stValue
"hansen" <as*****@hotmai l.com> wrote in message
news:e3******** ******@TK2MSFTN GP10.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)wh en 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
3591
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 in my variables ?? note1: I'm not the one who wrote the web service.. so I can't modify
4
8527
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 unique session ID in a cookie and referencing the SSN from the Session ID would be the correct way to do this. But since we have two separate servers, IIS and Websphere, how do we coordinate the session ID?
3
14929
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) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
5
6690
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 & "<br>"%> Exp <%'Response.Write GrantID & "<br>"%>
58
10121
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 code... TCHAR myArray; DoStuff(myArray);
20
1983
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> bool1=True lst1= def func1(arg1): arg1.append(4)
6
3248
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 query-string flag is used to indicate to the page whether it should instantiate a new instance of the object or access an existing instance from the calling page. On the both pages I have a property of the page which is an instance of this custom...
3
1566
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 page needs to reference. Thanks Lee
12
2677
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
2190
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 some scripts that run at the server for the form so I can't disable that statement. I followed Microsoft's instructions(I know..not the best thing to do) but still can't get the variables to pass. I created a class and set up an @reference...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8754
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8542
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1740
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.