【发布时间】:2014-12-24 12:39:30
【问题描述】:
在我的 aspx 页面中,我使用了 HyperLink 控件。在导航属性中,我试图连接字符串 url 和查询字符串值。在渲染 html 代码时,我看不到任何导航值。所以我无法使用我在 aspx 页面中生成的链接进行导航。代码如下:
<asp:HyperLink ID="linkRecord" runat="server" Text="Show number of records"
NavigateUrl='<%#String.Concat("~/ShowTables.aspx?ShowNumberOfRecords=Y&proj="
,Request.QueryString["proj"]) %>' />
但是当 html 在页面中呈现时,我发现了以下代码
<a id="linkRecord">Show number of records</a>
谁能告诉我哪里做错了。
谢谢
【问题讨论】:
-
您需要在某个时间点调用
linkRecord.DataBind()(例如,在Render中)以执行<%# ... %>数据绑定表达式中的代码。 -
@Rahul Singh,感谢您帮助我 :)