Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Online Exam Application

Online Exam Application

Scheduled Pinned Locked Moved ASP.NET
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sjs4u
    wrote on last edited by
    #1

    Hi, I want to create Questions on the form. Form contains 1 question at a time. I have arraylist with number of questions. From that arraylist I want to get the question and depending upon the next and prev button I want to circulate the question. How Can I Do this? Thanks

    I 1 Reply Last reply
    0
    • S sjs4u

      Hi, I want to create Questions on the form. Form contains 1 question at a time. I have arraylist with number of questions. From that arraylist I want to get the question and depending upon the next and prev button I want to circulate the question. How Can I Do this? Thanks

      I Offline
      I Offline
      Imran Khan Pathan
      wrote on last edited by
      #2

      sjs4u wrote:

      I want to create Questions on the form. Form contains 1 question at a time. I have arraylist with number of questions. From that arraylist I want to get the question and depending upon the next and prev button I want to circulate the question. How Can I Do this?

      if(!ispostback) { viewstate["index"]="0"; } On Next Button event if (viewstate["index"].ToString()=="0") { //Get question from arraylist with 0 index int.parse(viewstate["0"]) +=1; } else { //Get question from arraylist with viewstate index number string quest=arrlist[int.parse(viewstate["index"])] //check if question is from last array index then disable next button if(int.parse(viewstate["index"])==arrlist.count){ //disable next button}else{int.parse(viewstate["0"]) +=1;} } On Previous Button event if (viewstate["index"].ToString()=="0") { //Get question from arraylist with 0 index //disable previous button int.parse(viewstate["0"]) +=1; } else { //Get question from arraylist with viewstate index number string quest=arrlist[int.parse(viewstate["index"])] int.parse(viewstate["0"]) -=1; }

      please don't forget to vote on the post that helped you.

      S 1 Reply Last reply
      0
      • I Imran Khan Pathan

        sjs4u wrote:

        I want to create Questions on the form. Form contains 1 question at a time. I have arraylist with number of questions. From that arraylist I want to get the question and depending upon the next and prev button I want to circulate the question. How Can I Do this?

        if(!ispostback) { viewstate["index"]="0"; } On Next Button event if (viewstate["index"].ToString()=="0") { //Get question from arraylist with 0 index int.parse(viewstate["0"]) +=1; } else { //Get question from arraylist with viewstate index number string quest=arrlist[int.parse(viewstate["index"])] //check if question is from last array index then disable next button if(int.parse(viewstate["index"])==arrlist.count){ //disable next button}else{int.parse(viewstate["0"]) +=1;} } On Previous Button event if (viewstate["index"].ToString()=="0") { //Get question from arraylist with 0 index //disable previous button int.parse(viewstate["0"]) +=1; } else { //Get question from arraylist with viewstate index number string quest=arrlist[int.parse(viewstate["index"])] int.parse(viewstate["0"]) -=1; }

        please don't forget to vote on the post that helped you.

        S Offline
        S Offline
        SHatchard
        wrote on last edited by
        #3

        ...or he could do his homework himself :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups