希望 ASP.net 专家可以在这里帮助我,这很简单,但我一直在玩弄语法足够长的时间,知道我不知道。
我只是想在页面上内联 if 块。如果列表是赞助的,我想显示他们的网站地址。这个语法是什么样的?
//This is what I've been getting at:
<% if(Eval("Sponsored_Listing")=="Yes") {
//Then I want to simply write the URL on the page.
<a href="http://<#% Eval("Website") %>"><%# Eval("Website") %></a>
else {
//Do nothing -- nothing is written to screen.
}
%>
我觉得这是预处理器指令的问题。先感谢您。