Click here to Skip to main content
15,898,222 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Implement Inline Javascript in ASP.Net Pin
Not Active11-Aug-09 14:27
mentorNot Active11-Aug-09 14:27 
GeneralRe: Implement Inline Javascript in ASP.Net Pin
HistoricalSocietyMember12-Aug-09 2:48
HistoricalSocietyMember12-Aug-09 2:48 
GeneralRe: Implement Inline Javascript in ASP.Net Pin
Not Active12-Aug-09 11:00
mentorNot Active12-Aug-09 11:00 
GeneralRe: Implement Inline Javascript in ASP.Net Pin
HistoricalSocietyMember12-Aug-09 12:19
HistoricalSocietyMember12-Aug-09 12:19 
GeneralRe: Implement Inline Javascript in ASP.Net Pin
Not Active12-Aug-09 14:01
mentorNot Active12-Aug-09 14:01 
AnswerRe: Implement Inline Javascript in ASP.Net Pin
Christian Graus11-Aug-09 19:39
protectorChristian Graus11-Aug-09 19:39 
GeneralRe: Implement Inline Javascript in ASP.Net Pin
HistoricalSocietyMember12-Aug-09 2:51
HistoricalSocietyMember12-Aug-09 2:51 
Questionrepeater control Pin
deep7611-Aug-09 10:25
deep7611-Aug-09 10:25 
I want to create a quiz from my database as follows:
1 Diabetes is a disease that effects:
Babies
Children
Teenagers
Adults
Men
Women
All of the above

2 Increasing the amount of glucose (sugar) in blood effects:
Nothing
Heart
Nerves
Blood Vessels
2,3,4

3 Diabetes complications may include:
Stroke
Heart disease
Hypertension
Nerve problems
Gum infection
Kidney disease
Blindness
Amputation
All of the above
==================

Here is my code for the repeater control:
asp code:
<tr>
<td colspan="6" align="left" bgcolor="#eeeeee">
<asp:Repeater ID="rptrExample" runat="server">
<HeaderTemplate>
<%# DataBinder.Eval(Container, "DataItem.QID") %>
<%# DataBinder.Eval(Container, "DataItem.Question") %>
<br />
</HeaderTemplate>

<ItemTemplate>
<%# DataBinder.Eval(Container, "DataItem.Answer") %>
<br />
</ItemTemplate>
</asp:Repeater>
<asp:Label ID="lblStatus" runat="server"></asp:Label>
</td>
</tr>

aspx.cs code:
try
{
SqlConnection con = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand();
cmd.CommandType = System.Data.CommandType.Text;
String stmt = "select Q.QID as QID, Q.Question as Question, A.Answer as Answer from Curriculum_Questions Q INNER JOIN Curriculum_Answers A on Q.QID = A.QID where ChapterID = 2";
cmd.CommandText = stmt;
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
con.Open();
rptrExample.DataSource = cmd.ExecuteReader();
rptrExample.DataBind();
con.Close();
con.Dispose();
}
catch (Exception ex)
{
lblStatus.Text = ex.Message;
}
}

But I am not getting the desired result. Instead it is just showing all the answer choices only. No QID, Question. Please help me to understand why?
Is it possible to show answer choices as radio buttons in using repeater control?

Thank You.
AnswerRe: repeater control Pin
Abhijit Jana11-Aug-09 10:36
professionalAbhijit Jana11-Aug-09 10:36 
GeneralRe: repeater control Pin
deep7611-Aug-09 10:47
deep7611-Aug-09 10:47 
GeneralRe: repeater control Pin
Venkatesh Mookkan11-Aug-09 15:57
Venkatesh Mookkan11-Aug-09 15:57 
GeneralRe: repeater control Pin
deep7612-Aug-09 5:12
deep7612-Aug-09 5:12 
GeneralRe: repeater control Pin
Venkatesh Mookkan12-Aug-09 5:23
Venkatesh Mookkan12-Aug-09 5:23 
GeneralRe: repeater control Pin
deep7612-Aug-09 5:26
deep7612-Aug-09 5:26 
GeneralRe: repeater control Pin
Venkatesh Mookkan12-Aug-09 5:31
Venkatesh Mookkan12-Aug-09 5:31 
GeneralRe: repeater control Pin
deep7612-Aug-09 6:41
deep7612-Aug-09 6:41 
GeneralRe: repeater control Pin
Venkatesh Mookkan12-Aug-09 6:49
Venkatesh Mookkan12-Aug-09 6:49 
GeneralRe: repeater control Pin
deep7612-Aug-09 6:54
deep7612-Aug-09 6:54 
GeneralRe: repeater control Pin
deep7612-Aug-09 7:03
deep7612-Aug-09 7:03 
GeneralRe: repeater control Pin
Venkatesh Mookkan12-Aug-09 7:10
Venkatesh Mookkan12-Aug-09 7:10 
GeneralRe: repeater control Pin
Venkatesh Mookkan12-Aug-09 7:07
Venkatesh Mookkan12-Aug-09 7:07 
GeneralRe: repeater control Pin
deep7612-Aug-09 9:20
deep7612-Aug-09 9:20 
QuestionASP.NET Configuration Problem Pin
pampam11011-Aug-09 10:19
pampam11011-Aug-09 10:19 
AnswerRe: ASP.NET Configuration Problem Pin
Abhijit Jana11-Aug-09 10:42
professionalAbhijit Jana11-Aug-09 10:42 
GeneralRe: ASP.NET Configuration Problem Pin
pampam11012-Aug-09 22:21
pampam11012-Aug-09 22:21 

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.