Access control attribute in code

**I gave a button an attribute called notetype.** **I have a function from a different button's click that sets that variable to some type.** function addnotes(Type,IncId,Acc,Wit,Claim,Inj,Prop,Media) { var bttnopenmodal = $get('<%=bttnopenmodal.ClientID %>'); var bttnSave = $get('<%=bttnSave.ClientID %>'); if (Type == 'Inc') { bttnSave.notetype = 'Inc'; }; return false; } **However in the C# code of the button:** protected void bttnSave_Click(object sender, ImageClickEventArgs e) { Response.Redirect(bttnSave.Attributes["notetype"]); } **the value of the save button's notetype is still 'none' even though i change it in javascript. I even alerted to make sure it changed the notetype and it did. I tried to update the button with an updatepanel to no avail. How can i correctly change that notetype?**
Only the value attribute of a form control element is sent with the form post (and for nothing is sent at all). You can't expect the browser to know to send "notetype=none" in the post body just because you specified it as an attribute. That's what would be used for. Viewstate makes you forget all this, until the point you try to change it in the client and the whole thing blows up.

以上就是Access control attribute in code的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准