ASP.netÖÐlistview¿Ø¼þÓ÷¨
ListView »ù´¡
ListView ÊÇÄ£°åÇý¶¯µÄ¿Ø¼þ£¬ÕâÒâζ×ÅËüĬÈÏÇé¿öϲ»»á³ÊÏÖÈκÎÊý¾Ý——Äú±ØÐëÒÔÄ£°åµÄÐÎʽÍêÈ«Ö¸¶¨Ï£ÍûËü³ÊÏÖµÄ HTML¡£Óë´ó¶àÊýÄ£°å¿Ø¼þÀàËÆ£¬ItemTemplate ½«³ÉΪÄú¹¤×÷µÄÖص㣬ÄúÐèÒª½«°ó¶¨Êý¾Ý¼¯ÖÐÿһÐ⻶ÏÖظ´µÄ HTML ÄÚÈÝ·ÅÔÚ ItemTemplate Àï¡£
ListView ÖеÄй¦ÄÜ£¬Ò²ÊÇËüÓëÆäËü¿Ø¼þµÄÕæÕý²»Í¬Ö®´¦ÔÚÓÚÒý½øÁË LayoutTemplate¡£ÔÚ LayoutTemplate ÖУ¬Äú¿ÉÒÔ½«ÒªÊä³öµÄ¶¥¼¶ HTML ¶¨ÒåΪ¿Ø¼þ³ÊÏÖµÄÄÚÈÝ¡£ÀýÈ磬Èç¹ûÏ£Íû ListView ×÷Ϊ±í¸ñ³ÊÏÖ£¬Ôò¿ÉÒÔÔÚ LayoutTemplate Öаüº¬¶¥¼¶ <table> ºÍ <thead> ÔªËØ£¬°ÑÐк͵¥Ôª¸ñµÄ³ÊÏÖÁô¸ø ItemTemplate£¬Èçͼ 1 Ëùʾ£¨ÔÚ±¾Ê¾ÀýÖУ¬°ó¶¨µÄÊý¾ÝÔ´½«ÏÔʾ°üº¬µçÓ°±êÌâºÍ·¢ÐÐÈÕÆڵļòµ¥±í¸ñ£©¡£Í¼ 2 ÏÔʾÁËä¯ÀÀÆ÷³ÊÏÖ¡£
Figure 1 Using LayoutTemplate and ItemTemplate
¸´ÖÆ´úÂë
<asp:ListView runat="server" ID="_simpleTableListView"
DataSourceID="_moviesDataSource">
<LayoutTemplate>
<table>
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Release Date</th>
</tr>
</thead>
<tbody>
<asp:PlaceHolder runat="server" ID="itemPlaceholder" />
</tbody>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td><%# Eval("movie_id") %></td>
<td><%# Eval("title") %></td>
<td><%# Eval("release_date", "{0:d}") %></td>
</tr>
</ItemTemplate>
</asp:ListView>
Figure 2 ÏÔʾÔÚ±í¸ñÖеÄÁбí (µ¥»÷¸ÃͼÏñ»ñµÃ½Ï´óÊÓͼ)
LayoutTemplate ºÍ ItemTemplate Ö®¼äµÄ¹ØÁªÓÉ LayoutTemplate ÖÐ ID ÉèÖÃΪ itemPlaceholder µÄµ¥Ò»·þÎñÆ÷¶Ë¿Ø¼þÍê³É¡££¨Äú¿ÉÒÔʹÓà ListView µÄ ItemPlaceholderID ÊôÐÔ¸ü¸Ä ID ×Ö·û´®µÄĬÈÏÖµ¡££©ÔÚµÚÒ»¸öʾÀýÖУ¬ÎÒ½« PlaceHolder ¿Ø¼þµÄʵÀý·ÅÖÃÔÚÄ£°åÖУ¬¼´ÎÒÏ£Íû×¢Èë ItemTemplate ÄÚÈݵÄλÖá£Çë×¢Ò⣺¾¡¹Ü±ØÐëÖ§³Ö×ӿؼþ£¬µ«²¢Ã»ÓÐÏÞÖƱØÐëʹÓÃʲôÀàÐ͵Ŀؼþ×÷Ϊռλ·û——ID ²ÅÊÇÖØÒª¡£ÀýÈ磬ÎÒ¿ÉÒÔʹÓ÷þÎñÆ÷
Ïà¹ØÎĵµ£º
»ñÈ¡ ASP.NET ÌṩµÄµ±Ç° Session ¶ÔÏó ( HttpSessionState Àà )¡£¸ÃÊôÐÔÌṩÓйص±Ç°ÇëÇóµÄ»á»°µÄÐÅÏ¢¡£Îª´Ó ASP.NET Ó¦ÓóÌÐòÇëÇóÒ³»òÎĵµµÄÿ¸öÓû§Î¬»¤Ò»¸ö Session ¶ÔÏó¡£µ±Óû§ÔÚÓ¦ÓóÌÐòÖдÓÒ»Ò³Òƶ¯µ½Áíһҳʱ£¬´æ´¢ÔÚ Session ¶ÔÏóÖеıäÁ¿²»»á±»·ÅÆú£»Ïà ......
Èç¹ûÄúµÄ Web Ó¦ÓóÌÐò°üÀ¨ÒªÔÚ¶à¸öÒ³Ö®¼ä¹²ÏíµÄ´úÂ룬Äú¿ÉÒÔ½«´úÂë±£´æÔÚ Web Ó¦ÓóÌÐò¸ùĿ¼ÏµÄÁ½¸öÌØÊâÎļþ¼Ð£¨Bin Îļþ¼ÐºÍ App_Code Îļþ¼Ð£©ÖеÄij¸öÎļþ¼ÐÖС£
Bin Îļþ¼Ð
¿ÉÒÔÔÚ Bin Îļþ¼ÐÖд洢±àÒëµÄ³ÌÐò¼¯£¬²¢ÇÒ Web Ó¦ÓóÌÐòÈÎÒâ´¦µ ......
×î½üÏëÑо¿ÏÂweb service,ÄκÎÕÒ±éÍøÂ磬¶¼Êǽ²Ð©¶¨ÒåÐԵĶ«Î÷£¬·º·º¶ø̸£¬ÎÒ¿´µÄÒ»Öª°ë½â£¬²»µÃÒªÁì¡£²»¹ý½ñÌì×ÜËãÓеãÊÕ»ñ£¬Ð´ÁË ¸öСµÄweb serviceÀý×Ó£¬¾ÍÊÇÅжÏÒ»¸öÊýÊDz»ÊÇÖÊÊý¡£»¹ÊÇÀÏ»°£¬¸ø´ó¼ÒÆðÅ×שÒýÓñµÄ×÷Óã¬Ö»ÊǸø´ó¼Ò½²½âÈçºÎ¿ª·¢×î¼òµ¥µÄweb service³ÌÐò ¡£Ö»ÒªÈëÁËÃż÷£¬ÒÔºóµÄ·¾Í¿ÉÒÔ×Ô¼º×ßÁË¡£
µÚÒ»£¬ ......
Ò»¡£ÏÂÔص¼ÈëÏîÄ¿
£¨1£©Ê×Ïȵ½http://ckeditor.com/downloadÏÂÔØFCKeditor 2.6.5,ºÍFCKeditor.Net 2.6.3,
È»ºó½âѹÕâÁ½¸öÎļþ¼Ð
FCKeditor±à¼Æ÷£¬µÃµ½Îļþ¼Ðfckeditor£¬¸´ÖÆ´ËÎļþ¼Ðµ½WebÓ¦ÓõÄÏîÄ¿Ï£¨Ò²¿ÉÒÔÊÇ×ÓËïĿ¼Ï£©¡£
½âѹFCKeditor¿Ø¼þ£¬ÔÚÆä×ÓĿ¼bin/Release/2.0ÏÂÓÐÒ»¸ö³ÌÐò¼¯¡£ÔÚWebÓ¦ÓõÄÏîÄ¿ÖÐÒýÓøà ......
ÏÈ¿´¿´ASP.NETÒ³ÃæˢеÄʵÏÖ·½·¨£º
µÚÒ»£º
private void Button1_Click( object sender, System.EventArgs e ) { Response.Redirect( Request.Url.ToString( ) ); } µÚ¶þ£º
private void Button2_Click( object sender, System.EventArgs e ) { Response.Write( " < script language=javascript>window.locatio ......