【发布时间】:2015-09-04 20:30:46
【问题描述】:
根据here 的回答,我可以通过将其类型值设置为“按钮”来阻止按钮提交表单,就像在 HTML 中一样:
<button type="button">Cancel changes</button>
...但是如何在 C# 中做到这一点?我正在动态创建我的控件,就像这样(伪代码,因为我远离我的 IDE):
button btn = new Button
{
CSS = "bla"
}
btn.Type = "Button"; // <- something like this?
【问题讨论】:
-
Type的属性类型是什么?? -
您还可以将 UseSubmitBehavior="false" 添加到 asp:Button 控件。
标签: c# dynamic sharepoint-2010 submit-button htmlbutton