我想輸出可點擊的新聞標題列表。到目前爲止,我可以得到它打印出一個標題列表,因爲我拖放了VS 2010中的設計器視圖中的NewsHeadline表。您如何認爲我應該讓列表元素可點擊?我查找了一個URL屬性,但我沒有看到它。我是否需要包裝在<的href?將鏈接列添加到ASP.NET GridView
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1"
EmptyDataText="There are no data records to display.">
<Columns>
<asp:BoundField DataField="NewsHeadline" HeaderText="NewsHeadline"
SortExpression="NewsHeadline" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:ConnectionString1.ProviderName %>"
SelectCommand="SELECT [NewsHeadline] FROM [NewsTable]"></asp:SqlDataSource>
</form>
我不得不使用DataNavigateUrlFields是.NET 4的東西嗎? – 2013-05-09 05:13:13