如何在提交数据后清除用户控制值 [英] how to clear user control value after submit data
本文介绍了如何在提交数据后清除用户控制值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当天的问候,
我确实在我的注册表单上让用户控制日期选择器现在我想在提交后删除该控件的值
ex
mydatepicker.value.clear()我可以使用??
Greetings for the day,
I did make user control for date picker on my register form now i want to delete value of that control after submittion
ex
mydatepicker.value.clear() can i use ??
推荐答案
是的,你可以使用mydatepicker.value.clear()。它会工作。
yes you can use mydatepicker.value.clear(). it will work.
你可以使用下面的代码来重置
You can use below code to reset
public static void ClearTextBoxes(Control parent)
{
foreach (Control c in parent.Controls) {
if (c.GetType() == typeof(TextBox))
{
((TextBox)(c)).Text = string.Empty;
}
}
试试这个..
如何在点击重置按钮时重置datetimepicker控件的文本框? [ ^ ]
try this..
how to reset textbox of datetimepicker control on clicking reset button?[^]
这篇关于如何在提交数据后清除用户控制值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文