how to pass value to new page and display records
I got a script that it displays a content of access database. i want to pass value to another page when some one click on link(playerprofile )and it displays that record in a new page . I be happy if some one help me how i display the record from the passed by value person_id(from player table in acccess database).Thanks
i mean like this :select * from players where playerno= person_id
-------------------------------------------------------------------
playerlist.aspx
Database connection - Bind to a Repeater control source code:
<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server">
sub Page_Load
dim dbconn,sql,dbcomm,dbread
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("/db/TENNIS DATABASE.mdb"))
dbconn.Open()
sql="SELECT * FROM players"
dbcomm=New OleDbCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()
customers.DataSource=dbread
customers.DataBind()
dbread.Close()
dbconn.Close()
end sub
</script>
<html>
<body>
<form runat="server">
<asp:Repeater id="customers" runat="server">
<HeaderTemplate>
<table border="1" width="100%">
<tr bgcolor="#b0c4de">
<th></th>
<th>Player ID</th>
<th>Name</th>
<th>Initials</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr bgcolor="#f0f0f0">
<td><td><a href = "playerprofile.aspx?person_id=<%#Container.DataIte m("playerno")%>"><%#Container.DataItem("playerno") %></a></td>
<td><%#Container.DataItem("Name")%> </td>
<td><%#Container.DataItem("initials")%> </td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</form>
</body>
</html>
|