<a onclick= "javascript:ShowDialog(this.href);return false " class= "a2 "
href= "edit_news.aspx?id= <%#DataBinder.Eval(Container.DataItem, "news_id ")%> ">
<%# DataBinder.Eval(Container.DataItem, "news_title ")%>
</a>
错误:
未能在 "设计 "视图中打开。在 " <%... "值 "...%> "块中,以不同方式将值括起来
这个要怎么改才能在视图中可见
------解决方案--------------------------------------------------------
href用单引号试下
------解决方案--------------------------------------------------------
<a onclick= "javascript:ShowDialog(this.href);return false " class= "a2 "
href= ' <%# "edit_news.aspx?id= " + DataBinder.Eval(Container.DataItem, "news_id ")%> '>
<%# DataBinder.Eval(Container.DataItem, "news_title ")%>
</a>
------解决方案--------------------------------------------------------
<a onclick= "javascript:ShowDialog(this.href);return false " class= "a2 "
href= 'edit_news.aspx?id= <%#DataBinder.Eval(Container.DataItem, "news_id ")%> '>
<%# DataBinder.Eval(Container.DataItem, "news_title ")%>
</a>
------解决方案--------------------------------------------------------
Eval方法里那个字符串型参数 你已经用了双引号了 外围的href属性你就不能再用双引号了!!
------解决方案--------------------------------------------------------
<a onclick= "javascript:ShowDialog(this.href);return false " class= "a2 " href=‘edit_news.aspx?id= <%#DataBinder.Eval(Container.DataItem, "news_id ")%> ’>