ASP.NET¡¾DataGridView¡¿72¼Æ
DataGridView 72¼Æ
±¾ÎĽ«½éÉÜASP.NETÖÐDataGridViewµÄÓ÷¨,DataGridViewÔÚAsp.netÖÐÊdz£ÓõĿؼþÖ®Ò»£¬ÕÆÎÕºÃDataGridViewµÄÌصãºÍÓ÷¨¡£½«¶Ô³ÌÐòµÄÐÔÄÜÓдó´óµÄÌá¸ß£¬Í¬Ê±Ò²ÄܼӿìÎÒÃÇÏîÄ¿µÄ¿ª·¢ÖÜÆÚ£¡
¿ìËÙÔ¤ÀÀ£º
GridViewÎÞ´úÂë·ÖÒ³ÅÅÐò
GridViewÑ¡ÖУ¬±à¼£¬È¡Ïû£¬É¾³ý
GridViewÕý·´Ë«ÏòÅÅÐò
GridViewºÍÏÂÀ²Ëµ¥DropDownList½áºÏ
GridViewºÍCheckBox½áºÏ
Êó±êÒƵ½GridViewijһÐÐʱ¸Ä±ä¸ÃÐеı³¾°É«·½·¨Ò»
Êó±êÒƵ½GridViewijһÐÐʱ¸Ä±ä¸ÃÐеı³¾°É«·½·¨¶þ
GridViewʵÏÖɾ³ýʱµ¯³öÈ·È϶Ի°¿ò
GridViewʵÏÖ×Ô¶¯±àºÅ
GridViewʵÏÖ×Ô¶¨Òåʱ¼ä»õ±ÒµÈ×Ö·û´®¸ñʽ
GridViewʵÏÖÓÓ...”´úÌ泬³¤×Ö·û´®
GridViewÒ»°ã»»ÐÐÓëÇ¿ÖÆ»»ÐÐ
GridViewÏÔʾÒþ²ØijһÁÐ
GridViewµ¯³öÐÂÒ³Ãæ/µ¯³öд°¿Ú
GridView¹Ì¶¨±íÍ·(²»ÓÃjavascriptÖ»ÓÃCSS£¬2ÐдúÂ룬ºÜºÃÓÃ)
GridViewºÏ²¢±íÍ·¶àÖرíÍ·ÎÞ´íÍêÃÀ°æ£¨ÒԺϲ¢3ÁÐ3ÐоÙÀý£©
GridViewÍ»³öÏÔʾijһµ¥Ôª¸ñ£¨ÀýÈç½ð¶îµÍÓÚ¶àÉÙ£¬·ÖÊý²»¼°¸ñµÈ£©
GridView¼ÓÈë×Ô¶¯ÇóºÍÇóƽ¾ùֵС¼Æ
GridViewÊý¾Ýµ¼ÈëExcel/ExcelÊý¾Ý¶ÁÈëGridView
1.GridViewÎÞ´úÂë·ÖÒ³ÅÅÐò£º
Ч¹ûͼ£º
1.AllowSortingÉèΪTrue£¬aspx´úÂëÖÐÊÇAllowSorting="True"£»
2.ĬÈÏ1Ò³10Ìõ£¬Èç¹ûÒªÐÞ¸ÄÿҳÌõÊý£¬ÐÞ¸ÄPageSize¼´¿É£¬ÔÚaspx´úÂëÖÐÊÇPageSize="12"¡£
3.ĬÈϵÄÊǵ¥ÏòÅÅÐòµÄ£¬ÓÒ»÷GridViewµ¯³ö“ÊôÐÔ”£¬Ñ¡ÔñAllowSortingΪTrue¼´¿É¡£
2.GridViewÑ¡ÖУ¬±à¼£¬È¡Ïû£¬É¾³ý£º
Ч¹ûͼ£º
ºǫ́´úÂ룺
Äã¿ÉÒÔʹÓÃsqlhelper,±¾ÎÄûÓᣴúÂëÈçÏ£º
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;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
//ÇåÇåÔ¶ùhttp://blog.csdn.net/21aspnet
SqlConnection sqlcon;
SqlCommand sqlcom;
string strCon = "Data Source=(local);Database=Êý¾Ý¿âÃû;Uid=ÕʺÅ;Pwd=ÃÜÂë";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
&
Ïà¹ØÎĵµ£º
#region 1
private void CreateCheckCodeImage()
{
//»ñÈ¡Ëæ¼´×Ö·û´®
int number;
char code;
string checkCode = String.Empty;
System.Random random1 = new Random();
for (int i = 0; i < 5; i++)
{
number = random1.Next( ......
ÉÏ´Î×öÁ˸öÏîÄ¿£¬Éæ¼°µ½Êý¾Ý¿âµÄ»¹ÔºÍ»Ö¸´£¬µ½ÍøÉÏÕÒÁËһϣ¬ÊÇÀûÓÃSQLDMOʵÏֵģ¬Ö»ÒªÌí¼ÓSQLDMOÒýÓþͺÃÁË£¬
È»ºóÀûÓÃϱߵÄÀàµÄ·½·¨¾Í¿ÉÒÔʵÏÖÁË¡£
ÎÒ°ÑÔ×÷ÕßµÄÀàÀ©³äÁËһϣ¬¿ÉÒÔ×Ô¶¯Ê¶±ðweb.configÀï µÄÊý¾Ý¿âÁ¬½Ó×Ö·û´®£¬¿ÉÒÔͨ¹ý±äÁ¿ÉèÖû¹Ô»Ö¸´µÄÐÅÏ¢¡£
ÐèҪעÒâµÄʱ»¹Ô£¬»¹ÔµÄʱºòÎÊÌâ ......
ÔÚÈÕ³£Ñ§Ï°ºÍʹÓÃASP.NETµÄ¹ý³ÌÖУ¬ÓÐЩ±È½ÏÌØÊâÓÐÓõľÑéÊÕ¼¯ÔÚÕâÀ·½±ã×Ô¼º¼ÇÒäºÍÀí½â£¬Ò²Ï£ÍûÄÜ°ïÖúµ½Ò»Ð©³õѧÕ߲ο¼¡£Èç¹ûÓÐЩ²»×ãµÄµØ·½Ï£Íû¸ßÊÖ²»Áߴͽ̣¡£¡£¡
Ò»¡¢ÔÚÒ»°ã´¦ÀíÎļþ(ashx)ÖÐʹÓÃSessionʱ£¬ÐèÒªÒý½øÃüÃû¿Õ¼ä£ºusing System.Web.SessionState; ²¢ÇÒʹ¸ÃÀàÊµÏ ......
<SCRIPT LANGUAGE="javascript">
¡¡¡¡<!--
¡¡¡¡window.open ('page.html')
¡¡¡¡-->
¡¡¡¡</SCRIPT>
¡¡¡¡
¡¡¡¡ÒòΪ×ÅÊÇÒ»¶Îjavascripts´úÂ룬ËùÒÔËüÃÇÓ¦¸Ã·ÅÔÚ<SCRIPT LANGUAGE="javascript">±êÇ©ºÍ</script>Ö®¼ä¡£<!-- ºÍ -->ÊǶÔһЩ°æ±¾µÍµÄä¯ÀÀÆ÷Æð×÷Óã¬ÔÚÕâЩÀÏä¯ÀÀÆ÷ ......
Ò»¡¢ÈÏʶWeb.configÎļþ
Web.config ÎļþÊÇÒ»¸öXMLÎı¾Îļþ£¬ËüÓÃÀ´´¢´æ ASP.NET Web Ó¦ÓóÌÐòµÄÅäÖÃÐÅÏ¢£¨Èç×î³£ÓõÄÉèÖÃASP.NET Web Ó¦ÓóÌÐòµÄÉí·ÝÑéÖ¤·½Ê½£©£¬Ëü¿ÉÒÔ³öÏÖÔÚÓ¦ÓóÌÐòµÄÿһ¸öĿ¼ÖС£µ±Äãͨ¹ý.NETн¨Ò»¸öWebÓ¦ÓóÌÐòºó£¬Ä¬ÈÏÇé¿öÏ»áÔÚ¸ùĿ¼×Ô¶¯´´½¨Ò»¸öĬÈϵÄ& ......