Stylesheet form question

wsyeager

Centurion
Joined
Apr 10, 2003
Messages
140
Location
Weston, FL
I took over doing another webform in ASP.Net 2.0 from a fellow co-worker, and have the following setup:

I have 20 StyleSheet questions as presented in the following format:
1) Evaluate the variable expression x + y - z when: x = 783, y = 472, z = 322
A) 11
B) 633
C) 933
D) 1577
E) Unsure how to solve


Corresponding form names to the above code:
Code:
(document.EXAM.Q1[0].checked)
(document.EXAM.Q1[1].checked)
(document.EXAM.Q1[2].checked)
(document.EXAM.Q1[3].checked)
(document.EXAM.Q1[4].checked

Corresponding HTML for the above:
Code:
<span class="questionText">1) Evaluate the variable expression x + y - z when:  x = 783, y = 472, z = 322</span>
<br />
<input type="radio" name="Q1" value="A">
  <span class="questionText">A)   11</span>
</input>
<br />
<input type="radio" name="Q1" value="B">
  <span class="questionText">B)   633</span>
</input>
<br />
<input type="radio" name="Q1" value="C">
  <span class="questionText">C)   933</span>
</input>
<br />
<input type="radio" name="Q1" value="D">
  <span class="questionText">D)   1577</span>
</input>
<br />
<input type="radio" name="Q1" value="E">
  <span class="questionText">E)   Unsure how to solve</span>
</input>

The previous developer had the following code which never worked to try and find a value that the user put in for the question:
Code:
strQuery = "/*/section[@name='" & arrLineDetail(0) & "']/question[@label='" & arrLineDetail(1) & "']/option[@value='" & Request.Form(arrLineDetail(3)) & "']"

When debugging, this value (Request.Form(arrLineDetail(3)) ) is set to NOTHING. For each question, the developer had cycled thru trying to get the answers the user put in.

How can I retrieve the values from the form? I know what arrLineDetail means, so don't worrry about that. Don't forget, this stylesheet is not within a form tag....
 
Last edited by a moderator:
StyleSheet form question

In other words, how can I reference the form names from my code-behind in place of
Code:
Request.Form(arrLineDetail(3))

I know this will need to be Javascript form items that I will need to reference from my code-behind, b ut I don't know the proper syntax.
 
Is the HTML sampe above the output sent to the browser or the server side mark up? If you are using ASP.Net then you could use the web controls and not need to mess aroun with the Request.Form stuff at all.
 
Stylesheet form problem

PlausiblyDamp said:
Is the HTML sampe above the output sent to the browser or the server side mark up? If you are using ASP.Net then you could use the web controls and not need to mess aroun with the Request.Form stuff at all.

It's sent to the browser via the "View Source" from Intgernet Explorer. It's too deep already to change everything else around. I have to use the stylesheets.
 
Using the ASP.Net model doesn't prevent you from using stylesheets in any way whatsoever - it just seems an odd move to use ASP.Net 2 to mimic the ASP way of doing things...

Could you attach the aspx page and the code behind (or if not the actual file a sample that exhibits the same problem)?
 
Attached, you will find the neccessary files for the problem.

The code in question is inside the "GetAssessmentText" function on line 282 within the exam.aspx.vb file.

If you need any further info, please feel free to let me know.
 

Attachments

Back
Top