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) %>
精彩评论