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