Use the single answer list control in datalist to create a single answer exam

Source: Internet
Author: User

Database Structure:

Question table question

Questionbank)
Whether the primary key field Name field description data type length can be empty constraint default value remarks
Is questionid question No. int
Courseid course No. Int Is
Chaptersid chapter No. Int Is
Questiontypeid problem type No. Int Is
Questiontitle question nvarchar (2000) 2000 yes
Answer correct answer nvarchar (3000) 3000 Yes
Questionremark remarks nvarchar (3000) 3000 Yes

 <  Form  ID  = "Form1"  Runat = "Server"  >      <  Div  >          <  ASP: datalist  ID  = "Datalist1"  Runat  = "Server"  Onitemdatabound  = "Item_bound"  Onitemcommand  = "Datalistpolicitemcommand"  >             <  Itemtemplate  >                  <  Table  Style  = "Width: 100% ;"  >                      <  Tr  >                          <  TD  >                              <%  # Eval  (  "  Questionid  "  )  %>                          </  TD  >                          <  TD  >                              <% #  Eval  (  "  Questiontitle  "  )  %>                          </  TD  >                      </  Tr  >                     <  Tr  >                          <  TD  >                          </  TD  >                          <  TD  >                              <  ASP: radiobuttonlist  ID  = "Radiobuttonlist1"  Runat = "Server"  >                              </  ASP: radiobuttonlist  >                          </  TD  >                      </  Tr  >                  </  Table  >              </  Itemtemplate  >             <  Footertemplate  >                  <  ASP: button  ID  = "Button1"  Commandname  = "Updateit"  Runat  = "Server"  Text  = "Submit"   />              </  Footertemplate  >         </  ASP: datalist  >      </  Div  >      </  Form  > 

 

 

Options
Whether the primary key field Name field description data type length can be empty constraint default value remarks

Optionsid option number int

Answers_n option varchar (2) 2 is
Content of the answer_content option varchar (2000) 2000 is
Istrueanswer correct answer bit is
Questionid question No. Int Is

 

Default. aspx mainCode:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.