共用方式為


Method 屬性 (Form)

設定或傳回用來送出表單的方法。預設值是 post

public System.Web.UI.MobileControls.FormMethod Method {
   get,
   set
}

備註

限制可張貼的資料量。當使用 get 參數要求時,某些回傳型別可能會失敗。get ** 要求的優點是所有參數都是指定為 URL 的一部份,因此可快取或儲存 URL。

範例

下列範例示範如何使用 Form 類別的 Method 屬性。

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   If Not IsPostBack
        Form1.Method = FormMethod.Post
   End If
End Sub

[C#]

private void Page_Load(object sender, System.EventArgs e)
{
  if(!IsPostBack)
  {
    Form1.Method= FormMethod.Post;
  }
}

請參閱

套用至:Form 類別