点击新闻标题在另一页显示该条新闻详细内容.net求代码
<asp:DataListID="xianshi"runat="server"BackColor="White"BorderColor="#E7E7FF"BorderSt...
<asp:DataList ID="xianshi" runat="server" BackColor="White" BorderColor="#E7E7FF"
BorderStyle="None" BorderWidth="1px" CellPadding="3"
DataSourceID="SqlDataSource1" GridLines="Horizontal" Height="184px"
Width="720px">
<AlternatingItemStyle BackColor="#F7F7F7" />
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<ItemStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<ItemTemplate>
<a href="newcontent.aspx?id='<%#Eval("id")%>'"><asp:LinkButton OnClick="dian" ID="ti" runat="server" Text='<%# Eval("title") %>'></asp:LinkButton></a>
<br />
<asp:Label ID="timeLabel" runat="server" Text='<%# Eval("time") %>' />
<br />
<br />
</ItemTemplate>
<SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:rongchangtouziConnectionString %>"
SelectCommand="SELECT [id],[title], [time],[content] FROM [News] ORDER BY [time] DESC">
</asp:SqlDataSource>
以上是标题列表的代码 想在newcontent.aspx显示点击新闻标题详细内容 展开
BorderStyle="None" BorderWidth="1px" CellPadding="3"
DataSourceID="SqlDataSource1" GridLines="Horizontal" Height="184px"
Width="720px">
<AlternatingItemStyle BackColor="#F7F7F7" />
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<ItemStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<ItemTemplate>
<a href="newcontent.aspx?id='<%#Eval("id")%>'"><asp:LinkButton OnClick="dian" ID="ti" runat="server" Text='<%# Eval("title") %>'></asp:LinkButton></a>
<br />
<asp:Label ID="timeLabel" runat="server" Text='<%# Eval("time") %>' />
<br />
<br />
</ItemTemplate>
<SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:rongchangtouziConnectionString %>"
SelectCommand="SELECT [id],[title], [time],[content] FROM [News] ORDER BY [time] DESC">
</asp:SqlDataSource>
以上是标题列表的代码 想在newcontent.aspx显示点击新闻标题详细内容 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励20(财富值+成长值)
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询