1.  准備條件

參數:ObjectDataSource用法之一(SelectMethod來進行簡單的邦定)

2.  在業務處理類中添加如下方法

public void InsertItem(string UID, string PWD, string Email)
{
    HttpContext.Current.Response.Write("UID = " + UID + "<br/>");
    HttpContext.Current.Response.Write("PWD = " + PWD + "<br/>");
    HttpContext.Current.Response.Write("Email = " + Email + "<br/>");
}

3. aspx頁面內容為

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
    SelectMethod="AllItems" InsertMethod="InsertItem" TypeName="Member">
</asp:ObjectDataSource>
<asp:DetailsView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateInsertButton="true">
</asp:DetailsView>

說明:好像沒什么好說的......

相关文章:

  • 2022-12-23
  • 2021-06-09
  • 2021-11-22
  • 2021-11-21
  • 2021-07-24
  • 2022-12-23
  • 2021-04-14
  • 2021-11-20
猜你喜欢
  • 2021-08-29
  • 2021-09-05
  • 2021-12-06
  • 2022-12-23
  • 2021-11-23
  • 2022-02-05
  • 2021-10-24
相关资源
相似解决方案