線上討論 關於asp.net頁面無法重新整理問題?有沒有好的辦法解決??

來源:互聯網
上載者:User

為什麼我的一個頁面a.aspx裡有一個提交按鈕   ,Page_Load裡:  
  private   void   Page_Load(object   sender,   System.EventArgs   e)  
  {  
  //   在此處放置使用者代碼以初始化頁面  
  strReportCode   =Context.Request.QueryString["ReportCode"];  
  HttpCookie   cookie   =   Request.Cookies   ["MyFirstCookie"];  
  if(!IsPostBack)  
  {  
  BindDropDownList();//綁定DropDownList  
   
  BindHour();//綁定DropDownList  
  BindSolveWayName();//綁定DropDownList  
  BindServeWay();//綁定DropDownList  
  lbName.Text=cookie["ServerName"].ToString();//為lable賦值  
  }  
   
  }  
  private   void   btnAdd_Click(object   sender,   System.EventArgs   e)  
                                      {  
                                                    //向資料庫中插入記錄  
                                        }  
   
  每次重新整理頁面得時候會自動執行btnAdd_Click(),而且點擊瀏覽器得後退按鈕也是。我覺得每次重新整理頁面得時候首先要執行PAGE_Load函數。可是我的PAGE_Load()沒有調用btnAdd_Click()啊。  
  到底時哪裡出了問題了那? 

------------------------

出現提示::::

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.