// 1.获取按钮在客户端ID
string strBtnClientID = imgBtnFastReply.ClientID;
// 2.设置js字符串
StringBuilder strPrevReplyRepeatJS = new StringBuilder();
strPrevReplyRepeatJS.Append("if(document.getElementById('" + strBtnClientID + "').value==0)");
strPrevReplyRepeatJS.Append("{document.getElementById('" + strBtnClientID + "').value=1}");
strPrevReplyRepeatJS.Append("else{return false;}");
// 3.设置为按钮的OnClientClick属性
imgBtnFastReply.OnClientClick = strPrevReplyRepeatJS.ToString();
该段代码可加入到页面的Page_Load事件中去