ASP.NET GridViewµÄʹÓÃÏê½â
ÕâÊÇҪʵÏֵŦÄÜ£º
µÚÒ»²½£ºÍÏÈëGridView¿Ø¼þ ²¢ÇÒÍê³É²éѯËùÓÐÊý¾ÝµÄ·½·¨ ͨ¹ýthis.GridView1.DataSource »ñÈ¡¼¯ºÏÊý¾Ý GridView1.DataBind() °ó¶¨Êý¾Ý
µÚ¶þ²½£ºÊµÏÖÈ«Ñ¡¹¦ÄÜ
1. Ò³Ãæ´úÂ룺
´úÂë
<asp:TemplateField HeaderText="È«Ñ¡">
<HeaderTemplate>
<input type="checkbox" id="CheckBox1" name="CheckBox1" onclick="GetAllCheckBox(this)" />
È«Ñ¡
</HeaderTemplate>
<ItemTemplate>
<input type="checkbox" name="CheckBox2" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="100px" />
</asp:TemplateField>
2. ʵÏÖÈ«Ñ¡µÄJS´úÂ룺
´úÂë
<script type="text/javascript" language="javascript">
function GetAllCheckBox(checkAll){
var items = document.getElementsByName("CheckBox2");
for(var i=0;i<items.length;i++){
&
Ïà¹ØÎĵµ£º
ÔÚASP.NET³öÏÖ´íÎóʱ£¬Ó¦¸ÃÏȼì²éASP.NET»·¾³ÊÇ·ñÕýÈ·´î½¨£¬±ÈÈçÒÔϼ¸¸ö·½Ã棺
1¡¢ÊÇ·ñ°²×°ÏàÓ¦°æ±¾µÄ.NET Framework³ÌÐò£¬²¢´òºÃÁ˲¹¶¡¡£
2¡¢IISÊÇ·ñ°²×°ÔËÐÐÕý³££¬Õ¾µã·¾¶¼°ASP.NET°æ±¾ÊÇ·ñÅäÖÃÕýÈ·¡£
3¡¢ÔÚIIS WEB·þÎñÀ©Õ¹ÖУ¬ÊÇ·ñÔÊÐíÁËASP.NETÀ©Õ¹¡£
4¡¢ÊÇ·ñÓа²È«·À»¤Èí¼þ½ûÖ¹ÏòWindowsºÍTempÎļþ¼ÐдÈëÎÄ ......
ÔÚûÓÐ<asp:UpdatePanel ID="up" runat="server"> <ContentTemplate>ÎÞˢл·¾³ÖУº
Response.Write("<script>alert('¹§Ï²Äú£¬Òѳɹ¦¼ÓÈëµ½ÄúµÄÈ˲ſ⣡');</script>");
ÔÚÓÐ<asp:UpdatePanel ID="up" runat="server"> <ContentTemplate>ÎÞˢл·¾³Ö ......
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Text;
names ......
1.ǰ̨ҳÃæÒ»°ã²»ÓÃgridview datalist treeview updatepanel µÈ¿Ø¼þ£¬ÒòΪËûÃÇ»áÉú³ÉºÜ¶àÎÒ²»ÏëÒªµÄ´úÂë¡£¶øÇÒǶÌ×Ò»´ó¶Ñtable
2.ÓÃrepeater+div+css+ul liÒѾ×ã¹»ÎÒ×öºÜ¶à¶«Î÷ÁË¡£
3.·¢²¼ºóµÄÒ³Ã棬¿ÉÒÔ°ÑһЩ¿ÕÐкͻ»ÐÐ ºÍһЩ²»±ØÒªµÄ¿Õ¸ñÈ¥µô£¬¾¡Á¿¼õÉÙaspxÒ³ÃæµÄÈÝÁ¿¡£Ìá¸ß¼ÓÔØËٶȡ£
4.ÔÚÒ³ÃæµÄtitleдÉϱ¾Ò³ÄÚÈÝ ......