qq_42450386
吃瓜日常
2018-12-21 08:43

ASP.NET WebForm中如何后台给GridView控件绑定数据?

  • c#
  • asp.net
  • visual studio

前台代码:

<body>
    <form id="form1" runat="server">
    <div>
        &nbsp;<asp:GridView 
            ID="GridView1" runat="server" 
            onselectedindexchanged="GridView1_SelectedIndexChanged">
        </asp:GridView>
    </div>
    </form>
</body>

后台代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace Chart
{
    public partial class Chart3 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答

为你推荐