开发者

error in using BtnSubmit.Attributes("onclick") in asp.net

can anybody tell me what is problem in

BtnSubmit.Attributes("onclick") = string.Format("document.getElementById(\'{0}\').value= document.getElementById(\'{1}\').value;", this.HiddenField1.ClientID, this.FileUpload1.ClientID)开发者_开发知识库;

it is giving me error 'Non invocable memberusing System.Web.UI.WebControls.Attributes cannot be used like method.'


Please use Attributes properly. As it's an readonly property you can use it like this:

BtnSubmit.Attributes.Add("onclick", string.Format("document.getElementById(\'{0}\').value= document.getElementById(\'{1}\').value;", this.HiddenField1.ClientID, this.FileUpload1.ClientID));
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜