Regarding ASP.NET Mobile Web Application
Hi guys,
I doing a project using ASP.NET mobile web application using MS Access as my database. problem is that i only have basic knowledge in Visual Basic.NET programming.
Right now, I'm looking for codes for generating radio buttons and labels(name) depends on the number of student in my MS Access table.
here the example: if there is 6 student in the table, it will generate 6 label and radio buttons.
http://i142.photobucket.com/albums/r82/askshiver/ss.png
Later, The attendence field in MS access will be updated increament the value by 1 depend on the radio button that has been clicked.
Is there anyone out there able to help me out? or codes i can refer to? thanks in advance. :)
Re: Regarding ASP.NET Mobile Web Application
you will need to create the control dynamically....
add a datatable to the page if it exists in asp.net mobile
Dim tableHeading As TableRow = New TableRow
'Create and add the cells that contain the Student ID column heading text.
Dim selectHeading As TableHeaderCell = New TableHeaderCell
selectHeading.Text = "Select"
selectHeading.HorizontalAlign = HorizontalAlign.Left
tableHeading.Cells.Add(selectHeading)
Dim l_nameHeading As TableHeaderCell = New TableHeaderCell
l_nameHeading.Text = "Student Name"
l_nameHeading.HorizontalAlign = HorizontalAlign.Left
tableHeading.Cells.Add(l_nameHeading)
tblStuds.Rows.Add(tableHeading)
Now what you need to do is get all the students data using a datareader, dataset or array of objects and increment through it and use the following
Dim detailsRow As TableRow = New TableRow
Dim l_cellSelect As New TableCell
Dim l_selector As New RadioButton
l_selector.ID = l_student.StudentID
l_cellSelect.Controls.Add(l_selector)
detailsRow.Cells.Add(l_cellSelect)
Dim l_nameCell As TableCell = New TableCell
l_nameCell.Text = l_student.StudentName
detailsRow.Cells.Add(l_nameCell)
tblOrders.Rows.Add(detailsRow)