asp.net gridview DataNavigateUrlFormatString from DataSource

两盒软妹~` 提交于 2019-12-05 22:20:52

Use databinding on the NavigateUrl attribute, like this:

NavigateUrl = '<%# Bind("ClientWebSite") %>'

Or more fully:

<asp:HyperLinkField DataTextField='<%# Bind("Client" %>' HeaderText="Client" NavigateUrl='<%# Bind("ClientWebSite") %>'>
    <HeaderStyle HorizontalAlign="Center" />
    <ItemStyle HorizantalAlign="Left" />
</asp:HyperLinkField>

DataNavigateUrlFields is used to gets or set the names of the fields from the data source used to construct the URLs for the hyperlinks in the HyperLinkField object.

'DataNavigateUrlFormatString` is used to gets or sets the string that specifies the format in which the URLs for the hyperlinks in a HyperLinkField object are rendered.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!