Click here to Skip to main content
14,935,565 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i want to design a table whose rows are retrieved from another aspx page via xml
say i have a page getstudents.aspx
which gives all the students in the database in the following format

this way i get data from getstudents.aspx
now i want to design a page selectstudents.aspx
which outputs following html (a table with a checkbox in each row)
in the following way
<script type="text/javascript">
var values[];
function add(x)
//adds the value of ticked checkbox in values array and removes it when unticked
			<td> </td>
			<td><input type="checkbox" name="cbRoll" value="8001" id="cbRoll8001" /></td>
			<td><input type="checkbox" name="cbRoll" value="8002" id="cbRoll8002"/></td>
	<form id="form1" name="form1"> 

the table with checkboxes is dynamically generated at runtime
with id of checkbox,value of checkbox(8001,8002,etc) and the name (AAAA,BBBB,etc) in the next corrosponding column
by reading data from xml given by page getstudents.aspx
a function (say) addremove( should be called whenever a checkbox is ticked
or unticked which should add or remove the value of checkbox (8001,8002,etc) to/from a string array named (say) 'values'
i will then submit to the webpage a string via POST containing "8001;8002;8003 and so on"
depending on which checkboxes are checked
obviously i will make the string from the array 'values'
i do not want to use readymade usercontrols avail in
what i want to do is more complicated than this, but this is a simplified version of it
so for this what should be structure of aspx page and what should be code behind in c#?

thanks in advance
Updated 30-May-11 6:39am
Sergey Alexandrovich Kryukov 30-May-11 12:37pm
What's the question?
tihcra 30-May-11 12:39pm
i want to know what should i write for aspx page and what should code should be written in codebehind c# file
OK, I think you got a good solution. Will you formally accept it?
tihcra 30-May-11 13:04pm
basically where to add javascript code and how to call it ?

1 solution

You may find[^] interesting.

Afterwards you will be able to pull data from getstudents.aspx, create a DataTable, fill it with the data, and assign it to tha DtaSource property of a DataGridView.

Best regards
Espen Harlinn
Looks like a handy tutorial; you usually suggest useful reading; my 5.
I advised OP to accept it formally as the solution.
Espen Harlinn 7-Jun-11 10:57am
Thank you, SAKryukov!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900