重置或清除ASP.NET中的按钮 [英] Reset or clear button in ASP.NET

查看:158
本文介绍了重置或清除ASP.NET中的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在ASP.NET中编写重置或清除按钮的编码???



问候

Balamurugan

解决方案

你可以这样做:



 受保护  void  Reset_Click( object  sender,EventArgs e)
{
TextBox1.Text = string .Empty;
TextBox2.Text = string .Empty;
// 等等所有控件
}






标准ASP.Net Button的使用是服务器端控件,需要额外的再现。可以使用HTML重置按钮来改善Web应用程序的性能。



使用< input>添加重置按钮控件as,



< input type =resetvalue =重置/>



此致,

Raghu


将此代码置于重置按钮点击事件



 Page.Response.Redirect(Page.Request.Url.RawUrl)


Hi,
How to write the coding for reset or clear button in ASP.NET???

Regards
Balamurugan

解决方案

You can do like this :

protected void Reset_Click(object sender, EventArgs e)
    {
        TextBox1.Text = string.Empty;
        TextBox2.Text = string.Empty;
        // so on youe all controls
    }


Hi,

The usage of Standard ASP.Net Button is a server side control and requires additional rendition. The HTML Reset button can be used instead to improve the performace of the web application.

Add a Reset Button controls using <input> as,

<input type="reset" value="Reset" />

Regards,
Raghu


Put this code on Reset button click event

Page.Response.Redirect(Page.Request.Url.RawUrl)


这篇关于重置或清除ASP.NET中的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆