1. 不能不触发, but tryvoid Page_Load(Object o, EventArgs e)
{
  if (!IsPostBack)
  {
         //your initialization code goes here
  }
}
2. >>>清空所以文本框
assume 文本框 are direct children of form1
<form id="form1" runat="server">
<asp:TextBox ...>
</form>...
foreach (Control c in form1.Controls)
{
   if (c is TextBox)
   {
     ((TextBox)c).Text = "";
   }
}

解决方案 »

  1.   

    要不触发Page_Load事件处理程序,可以把aspx页上的AutoEventWireUp设为false,在代码隐藏文件中不要为Page.Load绑定事件处理程序。
    清空文本框可以用思归的例子,我不懂vb.net,没法给出代码!
      

  2.   

    sub Page_Load(o as Object, e as EventArgs)
      if not IsPostBack then
             'your initialization code goes here
      end if
    end sub
    2. >>>清空所以文本框
    assume 文本框 are direct children of form1
    <form id="form1" runat="server">
    <asp:TextBox ...>
    </form>...
    dim c as Controlfor each c in form1.Controls
       if (TypeOf(c) is TextBox) then
         CType(c, TextBox).Text = ""
       end if
    next
      

  3.   

    思归, web窗体不识别form1,怎么办?
      

  4.   

    <form id="form1" runat="server">
    <asp:TextBox ...>
    ...
    </form>if you are using code-behind, declare in your Page class
    protected form1 as HtmlForm
      

  5.   

    saucer ,thank you ,but I want to use this sub in my entirely prject,
    so i make it global sub as following:
     
    public  sub cleartexts(byval frm as HtmlForm)
    dim c as Controlfor each c in frm .Controls
       if (TypeOf(c) is TextBox) then
         CType(c, TextBox).Text = ""
       end if
    end subnow,i invoke it as following:protected form1 as HtmlForm
    call cleartexts(form1)but it occurs error as following:未将object 引用 到 instance.what should i do?
      

  6.   

    看看你的ASPX中
    <form id="what" method="Post" runat="server">把:
    protected form1 as HtmlForm
    换为:
    protected what as HtmlForm
      

  7.   

    the question is ok.
    thank timmy3310(tim)  and saucer