Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 14th, 2005, 09:34 AM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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>





Similar Threads
Thread Thread Starter Forum Replies Last Post
I need to display 15 records per page only dreamer_0244 Crystal Reports 0 November 19th, 2007 04:16 AM
Display records in a table unmeshraut VB How-To 1 September 21st, 2007 12:04 PM
User choose number records to display per page jripke74 Classic ASP Databases 4 July 12th, 2004 11:19 AM
How to pass variables from Aspx page to Asp Page jayaraj Classic ASP Basics 2 May 23rd, 2004 06:56 AM
How to pass the variables in Aspx page to Asp Page jayaraj ASP.NET 1.0 and 1.1 Basics 3 May 23rd, 2004 06:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.