J
John sorCrer
Hi Guru's,
I am new to asp.net!
I can create a repeater control but would like to add a select list to
it as follows:
<%@ Page Language="vb" debug=true %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim myConnection As SqlConnection
Dim myCommand As SqlDataAdapter
myConnection = New SqlConnection("server=local;user
id=whocares;database=dbSeekersClientApp;Trusted_Connection=false")
myCommand = New SqlDataAdapter("SELECT ID, username, password,
firstname, surname, account_live FROM t_managers", myConnection)
Dim ds As Dataset = new DataSet()
myCommand.Fill(ds)
MyRepeater.DataSource = ds
MyRepeater.DataBind()
End SUb
</script>
<html>
<head>
</head>
<body>
<form action="intro1.aspx" method="post" runat="server">
<ASP:Repeater id="MyRepeater" runat="server">
<HeaderTemplate>
<table width="100%" style="font: 8pt verdana">
<tr style="background-colorFA894">
<th>
User ID
</th>
<th>
Surname
</th>
<th>
Firstname
</th>
<th>
Username
</th>
<th>
Password
</th>
<th>
Access
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr style="background-color:FFECD8">
<td>
<%# DataBinder.Eval(Container.DataItem, "ID") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "surname")
%>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"firstname") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"username") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"password") %>
<aspropDownList id="dList1" width=100 runat="server">
<option
value=<%#DataBinder.Eval(Container.DataItem, "account_live")%>>
</aspropDownList>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</ASP:Repeater>
</form>
</body>
</html>
Any pointers?
I am new to asp.net!
I can create a repeater control but would like to add a select list to
it as follows:
<%@ Page Language="vb" debug=true %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim myConnection As SqlConnection
Dim myCommand As SqlDataAdapter
myConnection = New SqlConnection("server=local;user
id=whocares;database=dbSeekersClientApp;Trusted_Connection=false")
myCommand = New SqlDataAdapter("SELECT ID, username, password,
firstname, surname, account_live FROM t_managers", myConnection)
Dim ds As Dataset = new DataSet()
myCommand.Fill(ds)
MyRepeater.DataSource = ds
MyRepeater.DataBind()
End SUb
</script>
<html>
<head>
</head>
<body>
<form action="intro1.aspx" method="post" runat="server">
<ASP:Repeater id="MyRepeater" runat="server">
<HeaderTemplate>
<table width="100%" style="font: 8pt verdana">
<tr style="background-colorFA894">
<th>
User ID
</th>
<th>
Surname
</th>
<th>
Firstname
</th>
<th>
Username
</th>
<th>
Password
</th>
<th>
Access
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr style="background-color:FFECD8">
<td>
<%# DataBinder.Eval(Container.DataItem, "ID") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "surname")
%>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"firstname") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"username") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"password") %>
<aspropDownList id="dList1" width=100 runat="server">
<option
value=<%#DataBinder.Eval(Container.DataItem, "account_live")%>>
</aspropDownList>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</ASP:Repeater>
</form>
</body>
</html>
Any pointers?