protected void Button1_Click(object sender, EventArgs e)
{
foreach (Control co in Page.Controls)
{
if (co is TextBox)
{
TextBox b = (System.Web.UI.WebControls.TextBox)co;
b.Text = string.Empty;
}
}
}
我想对页面所有TextBox控件进行操作;可惜实现不了string.Empty;是我哪写错的么
{
foreach (Control co in Page.Controls)
{
if (co is TextBox)
{
TextBox b = (System.Web.UI.WebControls.TextBox)co;
b.Text = string.Empty;
}
}
}
我想对页面所有TextBox控件进行操作;可惜实现不了string.Empty;是我哪写错的么
解决方案 »
- 如何设置owc11生成饼状图或者柱状图的tooltip
- 求个可以在dropdownlist中编辑的控件
- asp.net那个函数可以htmlencode单引号?
- ◆datatable分组问题◆
- *****散分100*****散分100*****散分100*****散分100*****------------一小时后封贴
- Asp.net怎么把网上的图片直接下载到本地硬盘
- v=opener.v是什么意思?
- 求教高手:ASP.NET(c#)中調用DTS
- MMS服务器问题 有的WMV能播放,有的不能
- 怎样向dataview中添加多个空行-----为这个问题开的第三个贴!!!
- 关于AJAX 中 UpdatePanel 里的 <%%>使用问题
- updatepanel中到处EXCEL诸个问题
就可以了,
浏览器没有null值这个东西
function Setvalue()
{
var a=document.getElementsByTagName("input");
for(var i=0;i<a.length;i++)
{
if(a[i].type="Text")
{
a[i].value="";
}
}
}
这个是if(a[i].type=="Text")
{
TextBox txt = null;
foreach (Control co in Page.Controls)
{
if (co.GetType().Name == "HtmlForm")
{
foreach (Control c1 in co.Controls)
{
if (c1.GetType().Name == "TextBox")
{
txt = ((TextBox)c1);
txt.Text = "bbb";
}
}
}
}
}