新人报到!

我--新人前来报到,请老前辈多指教! 
阅读更多

新人报到,求助(Gridview)问题

07-23

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

没有更多推荐了,返回首页