开发者

Asp.Net binding

Can I somehow evaluate a binding expression 开发者_开发问答like this in codebehind?

" Click('<%#SaveButton.ClientID%>'); DoSomethingElse('<%#CancelButton.ClientID%>')"


You should replace '#' by '='.


Supposed you used button, you can do sth like that in codebehind:

Button1.Attributes.Add("onclick", "functionName();");

^^


If it's necessary to bind the script on the page. There is some not very elegant way:

<%# String.Format("Click(\"{0}\";DoSomethingElse(\"{1}\")",SaveButton.ClientID,CancelButton.ClientID) %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜