博客來網路書店查詢

書名

博客來網路書店查詢

星期一, 7月 13, 2009

(ASP.Net) FormView1.DefaultMode變更

FormView1.DefaultMode代表FormView預設的模式,所以若要變更預設模式,

請呼叫FormView1.ChangeMode( ) ,ChangeMode內分別為

FormViewMode.ReadOnly:唯獨

FormViewMode.Edit:更新

FormViewMode.Insert:插入

以下透過三個按鈕變更FormView1的模式

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
FormView1.ChangeMode(FormViewMode.ReadOnly)
End Sub

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
FormView1.ChangeMode(FormViewMode.Edit)
End Sub

Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs)
FormView1.ChangeMode(FormViewMode.Insert)
End Sub

沒有留言: