ASP.NET??gridview???????е??????
???????????? ???????[ 2015/6/10 14:19:57 ] ???????????????
???????????塿
??????????????????????DropDownList?????????????AutoPostback???????DropDownList ??SelectedIndexChanged????У????GridView?е????С?
??????????SelectedIndexChanged????????????
????DropDownList ddl = (DropDownList)sender;
????GridViewRow gvr = (GridViewRow)ddl.NamingContainer;
????int id = int.Parse(GridView1.DataKeys[gvr.RowIndex][0].ToString());
????int num = int.Parse(ddl.Text);
?????????????????????????DropDownList?????
??????????????????NamingContainer???????????????????GridViewRow????
?????????????DropDoweList??button?????????????CommandName????????????NamingContainer?????????????
?????????????????NamingContainer?????????
???????????????????????????????????????????????????????????????? Control.ID ?????????????????
????ASP.NET Web ??ó???????????????????ν??????ν???????????????????? UI ????????????????????????ν??и?????????????????????? INamingContainer ?????????????????????????????????? ID ??????????????????
??????????б? Web ????????????? Repeater ?? DataList ???????????????????????????????????????????????????????????????е???????????????????????????÷?????????????????????????????????????Щ???????????????в?????? UniqueID ??????????????????????????????????? Page ????????
??????????????????????????????????????????????
??????????????
????????????????CheckBox?????????????CheckBox1_CheckedChanged????У????GridView?е????С?
????CheckBox chk = (CheckBox)sender;
????DataControlFieldCell dcf = (DataControlFieldCell)chk.Parent;
????GridViewRow gvr = (GridViewRow)dcf.Parent;
?????????????
????<asp:GridView ID="gvTest" runat="server">
????<Columns>
????<asp:TemplateField>
????<ItemTemplate>
????DisplayIndex : <%# Container.DisplayIndex %> || DataItemIndex : <%# Container.DataItemIndex %><br />
????</ItemTemplate>
????</asp:TemplateField>
????</Columns>
????</asp:GridView>
?????????????
?????????ID??Name?????????????????????????RowCommand()?????ж???е???????У??????????????????????e.CommandArgument???????????????????????GridView???????????????CommandArgument???????????????????????????????????????????????????GridView???????????????????????RowCreated????????????????????????linkButton???????к?д??CommandArgument?С?
????protected void gvInfo_RowCreated(object sender?? GridViewRowEventArgs e)
????{
????if (e.Row.RowType == DataControlRowType.DataRow)
????{
????LinkButton lk1 = (LinkButton)e.Row.FindControl("lkbtn");//LinkButton??ID
????lk1.CommandArgument = e.Row.RowIndex.ToString();
????}
????}
????protected void gvInfo_RowCommand(object sender?? GridViewCommandEventArgs e)
????{
????if (e.CommandName == "ADD")//??LinkButton??CommandName
????{
????int index = Convert.ToInt32(e.CommandArgument);
????string aa = gvInfo.Rows[index].Cells[1].Text.ToString();//?????????к?????????к??0???
????}
????}
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Asp.net MVC??ζ???????????????????????Trim????Asp.Net WebForm????????????asp.net ???????????Linux???Jexus?й?Asp.Net Core??ó???asp.net??????????????ASP.NET???????JSON????????????????ASP.NET MVC???????????Щ?£?Asp.net Core MVC?????SessionASP.NET Core???????7??????????????????[???]ASP.NET Core???????6??????????????????[???]ASP.NET Core???????5??????????????????ASP.NET???License Key??????ASP.NET Core 1.0?е???-?м????ASP.NET Core???????3???? ?????e??????[???]ASP.NET Core???????2??????????????ASP.NET?е????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????