Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在页面刷新时将文本框等用户控件字段值设置为 null。但是,一旦提交页面,即在提交按钮单击时设置空值,但在刷新页面时,它会保留旧值。那么如何将这些值设置为null。
在OnLoad你的 userControl 的方法中添加这个
OnLoad
if(IsPostBack) { myTextBox.Text = string.Empty; //here clear rest of your textboxes make your textboxes clear }
编辑:
method