protected void Button1_Click(object sender, EventArgs e)
{
int count = 0;
foreach (Control c in this.form1.Controls)
{
if (c.GetType() == typeof(TextBox))
{
TextBox txt = null;
txt = ((TextBox)c);
string txtString = txt.Text;
LMBLL.IfInSql.ProcessSqlStr(txtString); //判断是否含有非法字符
if (LMBLL.IfInSql.ProcessSqlStr(txtString) == false)
{
count++;
}
}
}
用着个方法判断页面中是否含有非法字符,单个页面已经能实现,我想把它封装成方法,但是不知道怎么把每个页面的this.form1.Controls传递出去,不知道this.form1.Controls是什么类型的