HTML重置按钮在asp.net中无法正常工作 [英] html reset button not working properly in asp.net

查看:72
本文介绍了HTML重置按钮在asp.net中无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专家,

在我的asp.net网站上有一个category.aspx页面.


在该页面上,我采用的形式包括一个下拉列表,一个文本框,1个 asp.net按钮(buttOk)和一个 html重置按钮.

最初的重置按钮会重置所有控件.
但是当我单击确定按钮(buttOk)时不起作用.当下拉列表selectedindexchanged事件触发时,也会发生同样的事情.

asp.net中是否存在任何可重置的控件?还是我必须为此编写代码?


预先感谢.

Hi Expert,

In my asp.net website there is one page category.aspx.


On that page i take form which contain one dropdownlist, one textbox,1 asp.net button(buttOk), and one html reset button.

Initially reset button reset all the control.
But When i click Ok button(buttOk) it not working.same thing happens when dropdownlist selectedindexchanged event fires.

Is there any control present in asp.net for reset? or i have to write code for it?


Thanks in advance.

推荐答案

最好使用ASP.net按钮并在其click事件上编写代码
Its better that you use an ASP.net button and write code on its click event



放置一个Asp.Net按钮控件,并在Click事件中编写代码.

页面中的重置控件的示例代码:

Hi,
Place a Asp.Net Button Control and write a code in the Click Event.

The Sample Code for reset controls in a page:

dropdownlist1.SelectedIndex = dropdownlist1.Items.IndexOf(dropdownlist1.Items.FindByText(string.Empty)); //For this u need to add string.Empty value in the control load time.

Txtbox1.text = string.Empty;



谢谢...



Thanks...


这篇关于HTML重置按钮在asp.net中无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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