Click here to Skip to main content
15,889,281 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: ajax and img Pin
Guffa1-Oct-06 8:11
Guffa1-Oct-06 8:11 
AnswerRe: ajax and img Pin
morteza572-Oct-06 12:25
morteza572-Oct-06 12:25 
QuestionPasswords Pin
TheEagle1-Oct-06 5:51
TheEagle1-Oct-06 5:51 
AnswerRe: Passwords Pin
sanju02761-Oct-06 6:40
sanju02761-Oct-06 6:40 
GeneralRe: Passwords Pin
TheEagle1-Oct-06 17:39
TheEagle1-Oct-06 17:39 
Questionhow to take web form textbox in array Pin
omi981-Oct-06 4:35
omi981-Oct-06 4:35 
AnswerRe: how to take web form textbox in array Pin
CWIZO1-Oct-06 5:05
CWIZO1-Oct-06 5:05 
Questionrandomizing order or ListBox or Hashtable items - how? Pin
Alice@mywonderland1-Oct-06 3:34
Alice@mywonderland1-Oct-06 3:34 
I'm building an application for students to answer test questions, and later get feedback on their learning. I have an SQL database holding the questions and their associated multiple choice answers. Answers to each question have an integer ID number, starting at one. The correct answer is always ID 1.

I want to be able to display the multiple choices in a ListBox, in a random order. At the moment I have an SQL call to the database to extract the appropriate answers, ordered by NewID (random). These fill a DataSet and this is then used to fill a Hashtable of the AnswerID and Answer Text pairs.

While the items are placed into the Hashtable in the random order that they were retrieved from the database, they seem to reorder themselves numerically once in the Hashtable. Therefore when my ListBox (showing only the answer text) binds to the Hashtable it always shows the correct answer in the last slot in the list.

How can I ensure that the items in either the Hashtable or the ListBox are randomized?

Many thanks,
Alice
AnswerRe: randomizing order or ListBox or Hashtable items - how? Pin
Guffa1-Oct-06 14:52
Guffa1-Oct-06 14:52 
QuestionInsert menu created by sothink dhtml menu in asp.net page Pin
aligatojohn1-Oct-06 1:53
aligatojohn1-Oct-06 1:53 
QuestionCallback & Masterpage Pin
sbao0041-Oct-06 1:07
sbao0041-Oct-06 1:07 
AnswerRe: Callback & Masterpage Pin
minhpc_bk1-Oct-06 15:53
minhpc_bk1-Oct-06 15:53 
GeneralRe: Callback & Masterpage Pin
sbao0042-Oct-06 0:52
sbao0042-Oct-06 0:52 
GeneralRe: Callback & Masterpage Pin
minhpc_bk2-Oct-06 1:21
minhpc_bk2-Oct-06 1:21 
QuestionDifference between manual rendering and rendering by aspx Pin
thebread1-Oct-06 0:48
thebread1-Oct-06 0:48 
AnswerRe: Difference between manual rendering and rendering by aspx Pin
thebread1-Oct-06 21:35
thebread1-Oct-06 21:35 
GeneralRe: Difference between manual rendering and rendering by aspx Pin
minhpc_bk2-Oct-06 0:54
minhpc_bk2-Oct-06 0:54 
GeneralRe: Difference between manual rendering and rendering by aspx [modified] Pin
thebread2-Oct-06 4:13
thebread2-Oct-06 4:13 
GeneralRe: Difference between manual rendering and rendering by aspx Pin
minhpc_bk2-Oct-06 16:35
minhpc_bk2-Oct-06 16:35 
QuestionFYI WAP Link Pin
VickyC#1-Oct-06 0:35
VickyC#1-Oct-06 0:35 
Questiontree control in asp.net(c#) [modified] Pin
ptvce30-Sep-06 23:18
ptvce30-Sep-06 23:18 
QuestionPl Help - How to superimpose 2 images in ASP.net Pin
atulxxx30-Sep-06 22:00
atulxxx30-Sep-06 22:00 
QuestionAdjust to disable "Debugging Not Enabled" messagebox? Pin
pedestrian79730-Sep-06 17:35
pedestrian79730-Sep-06 17:35 
AnswerRe: Adjust to disable "Debugging Not Enabled" messagebox? Pin
e-laj30-Sep-06 18:11
e-laj30-Sep-06 18:11 
GeneralRe: Adjust to disable "Debugging Not Enabled" messagebox? Pin
pedestrian7971-Oct-06 17:02
pedestrian7971-Oct-06 17:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.