AppSettings快捷方式问题
我正在尝试使用 <%$ AppSettings: .. %> asp.net 用户控件中的快捷方式。
将属性绑定到应用程序设置时,我可以很好地使用语法,但是我想使用应用程序设置来保存页面 ID。例如:
<a href="default.aspx?page=<%$ AppSettings:TestPageID %>">Test link</a>
此方法不起作用,所以我的问题是,是否可以像这样使用 appsetting 快捷方式来插入文字,或者任何人都可以建议我实现此目的的方法。
非常感谢,
亚当
I am trying to use the <%$ AppSettings: .. %> shortcut in an asp.net user control.
I am able to use the syntax fine when binding a property to an appsetting, however I want to use an appsetting to hold a page id. for exmaple:
<a href="default.aspx?page=<%$ AppSettings:TestPageID %>">Test link</a>
This method does not work, so my question is, can the appsetting shortcut be used like this to insert a literal, or can anybody suggest a way I can achieve this.
Many thanks,
Adam
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将文字添加到锚标记中。
add literal into the anchor tag.
尝试:
Try:
只需将 runat=server 添加到原始的“a”标签中,一切都会正常工作,如下所示:
Just add runat=server to the original 'a' tag and everything will work properly like this: