Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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Ò³ÃæÖ¸Áî

ASP.NETÖ¸ÁîÔÚÿ¸öASP.NETÒ³ÃæÖж¼ÓС£Ê¹ÓÃÕâЩָÁî¿ÉÒÔ¿ØÖÆASP.NETÒ³ÃæµÄÐÐΪ¡£ÏÂÃæÊÇPageÖ¸ÁîµÄÒ»¸öÀý×Ó£º
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
    Inherits="_Default" %>
ÔÚASP.NETÒ³Ãæ»òÓû§¿Ø¼þÖÐÓÐ11¸öÖ¸Áî¡£ÎÞÂÛÒ³ÃæÊÇʹÓúǫ́±àÂëÄ£ÐÍ»¹ÊÇÄÚÖñ ......

ASP.NETÒ³Ãæ¶ÔÏó

   »ñÈ¡ÇëÇóµÄÒ³µÄ HttpRequest ¶ÔÏó¡£
Ò»¡¢HttpRequest Àà
ʹ ASP.NET Äܹ»¶ÁÈ¡¿Í»§¶ËÔÚ Web ÇëÇóÆڼ䷢Ë굀 HTTP Öµ¡£
      ÏÂÃæµÄ´úÂëʾÀýʹÓà StreamWriter ÀཫÈô¸É HttpRequest ÀàÊôÐÔÖµµÄֵдÈëÎļþ¡£¶ÔÓÚÊÇ×Ö·û´®ÀàÐ͵ÄÊôÐÔ£¬ÊôÐÔÖµ±»Ð´ÈëÎļþʱ½«±»±àÂëΪ HTML¡£±íʾ¼¯ºÏµ ......

ASP.NETÔ¶³Ì±¸·Ý»Ö¸´SQL ServerÊý¾Ý¿â

///<summary>
      ///±¸·ÝÊý¾Ý¿âµ½±¾µØ´ÅÅÌ
      ///</summary>
    public bool BackUp(string BackUpFile)
    {
        try
&nbs ......

asp.net web serviceʵÀý

×î½üÏëÑо¿ÏÂweb service,ÄκÎÕÒ±éÍøÂ磬¶¼Êǽ²Ð©¶¨ÒåÐԵĶ«Î÷£¬·º·º¶ø̸£¬ÎÒ¿´µÄÒ»Öª°ë½â£¬²»µÃÒªÁì¡£²»¹ý½ñÌì×ÜËãÓеãÊÕ»ñ£¬Ð´ÁË ¸öСµÄweb serviceÀý×Ó£¬¾ÍÊÇÅжÏÒ»¸öÊýÊDz»ÊÇÖÊÊý¡£»¹ÊÇÀÏ»°£¬¸ø´ó¼ÒÆðÅ×שÒýÓñµÄ×÷Óã¬Ö»ÊǸø´ó¼Ò½²½âÈçºÎ¿ª·¢×î¼òµ¥µÄweb service³ÌÐò ¡£Ö»ÒªÈëÁËÃż÷£¬ÒÔºóµÄ·¾Í¿ÉÒÔ×Ô¼º×ßÁË¡£
µÚÒ»£¬ ......

asp.net Ò³ÃæÓÒϽǵ¯³öÀàËÆQQ»òMSNµÄÏûÏ¢Ìáʾ

<HTML><HEAD>
<TITLE>ÍøÒ³ÌØЧ¹ÛÖ¹|JsCode.CN|---Ò³ÃæÓÒϽǵ¯³öÀàËÆQQ»òMSNµÄÏûÏ¢Ìáʾ</TITLE>
<SCRIPT language=JavaScript>
<!--
/**//*
**    ==================================================================================================
**&nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ