日期:2014-05-18  浏览次数:20452 次

服务器标记的格式不正确!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<asp:Button   ID= "Submit1 "   runat= "server "   OnClick= " <%#   Submit1_Click(DataBinder.Eval(Container.DataItem,   "Comment ").ToString())%> "   Text= "提交 "/>

我要向OnClick事件的Submit1_Click函数棒定参数DataBinder.Eval(Container.DataItem,   "Comment ").ToString()时,总是报 "服务器标记的格式不正确 ",请问,我该怎么处理呢???

------解决方案--------------------
OnClick= "Submit1_Click <%#(DataBinder.Eval(Container.DataItem, "Comment ").ToString()%> ) "
------解决方案--------------------
OnClick= " <%# Submit1_Click(DataBinder.Eval(Container.DataItem, "Comment ").ToString())%> "
-----------------------------------------------
改成这样:
OnClick= ' <%# Submit1_Click(DataBinder.Eval(Container.DataItem, "Comment ").ToString())%> '
单引号!
------解决方案--------------------
<asp:Button ID= "Submit1 " runat= "server " OnClick= ' <%# Submit1_Click(Eval( "Comment "))%> ' Text= "提交 "/>