Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

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:

(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:

<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:

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....

Edited by PlausiblyDamp

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

Posted

StyleSheet form question

 

In other words, how can I reference the form names from my code-behind in place of

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.

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

Posted

Stylesheet form problem

 

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.

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

  • Administrators
Posted

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)?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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.

PlacementTests.zip

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

Posted
Actually, it's line 302.....

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...