[RESOLVED] ASP dynamically generates checkboxes...
...so what should ASP.NET equivalent do?
This is my asp code:
Code:
<%
Sub Show_Document_Type_Selection (typ)
Dim oConn
Dim oRS
Dim strSQL
strSQL = "SELECT toplvl_ik, des FROM toplvl ORDER BY des;"
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open ConnString
Set oRS = oConn.Execute (strSQL)
While Not oRS.EOF
%>
<INPUT TYPE="checkbox" NAME="toplvl" VALUE="<%=oRS("toplvl_ik")%>" <%If InStr(CStr(toplvl), oRS("toplvl_ik")) Then Response.Write " CHECKED" End If%>> <B><%=oRS("des")%></B>
<%If oRS("des") = "Savings Summary" Then
Response.Write "<BR>"
End If%>
<%
oRS.MoveNext
Wend
oRS.Close
Set oRs = Nothing
oConn.Close
Set oConn = Nothing
End Sub
%>
When I run that query in Query Analyzer, it returns me six rows and these are the six checkboxes.
Any advice on how this code can be migrated to .NET?
Re: ASP dynamically generates checkboxes...
i think you should use checkboxlist control.In that u can specify the datasource (Result of select query) ,Datatextfield (des ) and datavalueField (toplvl_ik).
Hope this will help u.
Re: ASP dynamically generates checkboxes...
I think so too.
Thanks for the quick reply.