现有两个页面zsb.aspx与z.aspx.两个页面中分别有一个datalist想实现在zsb.aspx中点新闻标题,然后在z.aspx中显示新闻对应的内容。怎么弄啊?
zsb.aspx代码:
<body>
<form id="form1" runat="server">
<div>
<asp:DataList ID="DataList1" runat="server" DataKeyField="pID" DataSourceID="SqlDataSource1"
Width="688px">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat ="server" Text = <%# Eval("标题")%> NavigateUrl ='z.aspx' ></asp:HyperLink><br />
<br />
<br />
</ItemTemplate>
</asp:DataList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:adoNetTestConnectionString15 %>"
SelectCommand="SELECT [pID], [标题] FROM [zsb]"></asp:SqlDataSource>
</div>
</form>
</body>
z.aspx代码:
<body>
<form id="form1" runat="server">
<div >
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" Height="188px"
Width="631px">
<ItemTemplate>
内容:
<asp:Label ID="内容Label" runat="server" Text='<%# Eval("内容") %>'></asp:Label><br />
<br />
</ItemTemplate>
</asp:DataList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:adoNetTestConnectionString17 %>"
SelectCommand="SELECT [内容] FROM [zsb] WHERe ([pID] = @pID)">
<SelectParameters>
<asp:QueryStringParameter Name="pID" QueryStringField="pID" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
谢谢大家了!