新人报到,求助(Gridview)问题
大家好,现在工作上(实习中)碰到一个问题。
低级问题,见笑。
我现在做了一个Gridview控件,根据不同的按钮对应不同的sqldatasource。这些都做好了。
在这个论坛上学习了以后,在控件上也加了编辑,删除,和新规生成的按钮。
可是,编辑和删除按钮添加完之后,直接就可以用了,但是,新规生成按钮,按了却没有反应。
请问应该在哪里加什么代码?
开发环境; Web developer 2005 语言;C#
sql server2005
希望结果是;编辑按钮时 对输入的数据进行验证(数值或文字)。
删除按钮时,增加一个删除确认的环节。
新规生成时,对输入的数据进行验证(数值或文字)。
附上我目前为止的代码;
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button_Tantou_Hensyu_Click(object sender, EventArgs e)
{
this.MultiView1.ActiveViewIndex = 0;
string temp = "担当リストの編集";
this.GridView2.DataKeyNames = new string[] { "担当编号" };
this.GridView2.DataSourceID = "SqlDataSource_Tantou";
}
protected void Button_SeikyuNo_Lenban_Hensyu_Click(object sender, EventArgs e)
{
this.MultiView1.ActiveViewIndex = 0;
string temp = "請求書番号の連番編集";
this.GridView2.DataKeyNames = new string[] { "区分" };
this.GridView2.DataSourceID = "SqlDataSource_Renban";
}
protected void Button_Jyohou_Hensyu_Click(object sender, EventArgs e)
{
this.MultiView1.ActiveViewIndex = 0;
string temp = "自社情報の編集";
this.GridView2.DataKeyNames = new string[] { "支店编号" };
this.GridView2.DataSourceID = "SqlDataSource_Mycompany";
}
protected void Button_Tani_Hensyu_Click(object sender, EventArgs e)
{
this.MultiView1.ActiveViewIndex = 0;
string temp = "単位編集";
this.GridView2.DataKeyNames = new string[] { "単位" };
this.GridView2.DataSourceID = "SqlDataSource_Tani";
}
protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
{
}