How to show Next, Previous records using ASP.Net +C#.Net..

Posted by Susantaown under ASP.NET on 3/9/2009 | Views : 11314 | Status : [Member] | Replies : 3
Hi all

I am developing online exam system..

I have 5 TextBoxes

TextBox1.text=question;
TextBox2.text=A;
TextBox3.text=B;
TextBox4.text=C;

2 Buttons
Next Prev

(All the Question and Option(A,B,C,D) are comming from Databases...)

To show next record i am using Next Button,
To Show previous record I am using Previous Button
user has to click the Next ya Prev buttons to view questions and relevant options for online test so how to do that....

NOTE:i am using asp.net + C#.Net

ThanX
susant




Responses

Posted by: Raja on: 3/9/2009 [Member] Starter

Up
0
Down
Here is some vague idea.

When you are showing the current record, store the recordid into ViewState and when user is clicking Next or Previous, get the id from ViewState and query the database greater than for next and less than for previous exam question.

In this way you will be able to code this.

Regards,
Raja, USA

Susantaown, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Poster on: 3/9/2009 [Member] Starter

Up
0
Down
I think the logic explained by Raja is enough to go ahead, if you have any specific question, please let us know.

Thanks

Susantaown, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neeks on: 3/9/2009 [Member] Bronze

Up
0
Down
You can write the code for the Form view as follow,

Here we are assigning the Paging functionality to the FOrmView.

You can remove Unwanted details from the FormView.

You can modify it as you wish,

Changes to be done:

1) provide your sqlDataSource Name instead of "studentDataSource"
2) change the appropriate binding with Eval() function. Provide your database field Names.

Please download the file for the code
 Download source file

Susantaown, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response