ASP.NET 2.0ÖÐʵÏÖÄ£°åÖеÄÊý¾Ý°ó¶¨
Ä£°å»¯µÄÊý¾Ý°ó¶¨¿Ø¼þΪÎÒÃÇÔÚÒ³ÃæÉÏÏÔʾÊý¾ÝÌṩÁ˸ù±¾µÄÁé»îÐÔ¡£Äã¿ÉÄÜ»¹¼ÇµÃASP.NET v1.xÖеļ¸¸öÄ£°å»¯¿Ø¼þ£¨ÀýÈçDataListºÍRepeater¿Ø¼þ£©¡£ASP.NET 2.0ÈÔȻ֧³ÖÕâЩ¿Ø¼þ£¬µ«ÔÚÄ£°åÖаó¶¨Êý¾ÝµÄÓï·¨ÒѾ±»¼ò»¯ºÍ¸ÄÉÆÁË¡£±¾ÎĽ«ÌÖÂÛÔÚÊý¾Ý°ó¶¨¿Ø¼þÄ£°åÖаó¶¨Êý¾ÝµÄ¶àÖÖ·½·¨¡£
Êý¾Ý°ó¶¨±í´ïʽ
ASP.NET 2.0¸ÄÉÆÁËÄ£°åÖеÄÊý¾Ý°ó¶¨²Ù×÷£¬°Ñv1.xÖеÄÊý¾Ý°ó¶¨Óï·¨DataBinder.Eval(Container.DataItem, fieldname)¼ò»¯ÎªEval(fieldname)¡£Eval·½·¨ÓëDataBinder.EvalÒ»Ñù¿ÉÒÔ½ÓÊÜÒ»¸ö¿ÉÑ¡µÄ¸ñʽ»¯×Ö·û´®²ÎÊý¡£Ëõ¶ÌµÄEvalÓï·¨ÓëDataBinder.EvalµÄ²»Í¬µãÔÚÓÚ£¬Eval»á¸ù¾Ý×î½üµÄÈÝÆ÷¶ÔÏó£¨ÀýÈçDataListItem£©µÄDataItemÊôÐÔÀ´×Ô¶¯µØ½âÎö×ֶΣ¬¶øDataBinder.EvalÐèҪʹÓòÎÊýÀ´Ö¸¶¨ÈÝÆ÷¡£ÓÉÓÚÕâ¸öÔÒò£¬EvalÖ»ÄÜÔÚÊý¾Ý°ó¶¨¿Ø¼þµÄÄ£°åÖÐʹÓ㬶ø²»ÄÜÓÃÓÚPage£¨Ò³Ã棩²ã¡£µ±È»£¬ASP.NET 2.0Ò³ÃæÖÐÈÔȻ֧³ÖDataBinder.Eval£¬Äã¿ÉÒÔÔÚ²»Ö§³Ö¼ò»¯µÄEvalÓï·¨µÄ»·¾³ÖÐʹÓÃËü¡£
ÏÂÃæµÄÀý×ÓÑÝʾÁËÈçºÎʹÓÃеļò»¯µÄEvalÊý¾Ý°ó¶¨Óï·¨°ó¶¨µ½DataListÊý¾ÝÏîÄ£°å£¨ItemTemplate£©ÖеÄImage¡¢LabelºÍHyperLink¿Ø¼þ¡£
£¼asp:DataList ID="DataList1" RepeatColumns="5" Width="600" runat="server" DataSourceID="ObjectDataSource1"£¾
¡¡£¼ItemTemplate£¾
¡¡¡¡£¼asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl=''£¼%# Eval("PhotoID", "PhotoFormViewPlain.aspx?ID={0}") %£¾''£¾
¡¡¡¡£¼asp:Image ID="Image1" Runat="server" ImageUrl=''£¼%# Eval("FileName", "images/thumbs/{0}") %£¾'' /£¾£¼/asp:HyperLink£¾
¡¡¡¡£¼asp:Label ID="CaptionLabel" runat="server" Text=''£¼%# Eval("Caption") %£¾'' /£¾
¡¡£¼/ItemTemplate£¾
£¼/asp:DataList£¾£¼br /£¾
£¼asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="DataComponentTableAdapters.PhotosTableAdapter" SelectMethod="GetPhotosForAlbum"£¾
Êý¾Ý°ó¶¨Ò²¿ÉÒÔ×÷Ϊ¿Ø¼þµÄÖ÷ÌⶨÒ壨theme definition£©µÄÒ»²¿·Ö£¬ÕâÑùÎÒÃǾͿÉÒÔͨ¹ý¸Ä±äÖ÷ÌâÀ´ËæÒâµØ¸Ä±äÄ£°å»¯¿Ø¼þµÄ²¼¾ÖºÍÍâ¹Û¡£µ«ÊÇTheme£¨Ö÷Ì⣩ģ°åÖÐÖ»ÄÜʹÓÃEval£¨»òÕߺóÃæÌÖÂÛµÄBind£©¡£°ó¶¨µ½ÈÎÒâµÄÓû§´úÂëÊDZ»½ûÖ¹µÄ¡£
FormView¿Ø¼þ
DataList¿Ø¼þÔÚÀ´×ÔÊý¾ÝÔ´µÄÊý¾ÝÏîÖнøÐеü´ú²Ù×÷£¬²¢ÎªÃ¿¸öÊý¾ÝÏîÊä³öItemTemplate£¨Êý¾ÝÏîÄ£°å£©¡£Õâ¶ÔÓÚÏÔʾÊý¾ÝÏîÁбíÊÇÓÐÓõģ¬µ«ÊÇͨ³£Çé¿öÏ£¬ÄãÏ£ÍûÔÚÒ»¸ö´°ÌåÖÐʵÏÖ
Ïà¹ØÎĵµ£º
CTRL + SHIFT + BÉú³É½â¾ö·½°¸
CTRL + F7 Éú³É±àÒë
CTRL + O ´ò¿ªÎļþ
CTRL + SHIFT + O´ò¿ªÏîÄ¿
CTRL + SHIFT + CÏÔʾÀàÊÓͼ´°¿Ú
F4 ÏÔʾÊôÐÔ´°¿Ú
SHIFT + F4ÏÔʾÏîÄ¿ÊôÐÔ´°¿Ú
CTRL + SHIFT + EÏÔʾ×ÊÔ´ÊÓͼ
F12 תµ½¶¨Òå
CTRL + F12תµ½ÉùÃ÷
CTRL + ALT + J¶ÔÏóä¯ÀÀ
CTRL + ALT + F1°ïÖúĿ¼
CTR ......
ÔÚûÓÐ<asp:UpdatePanel ID="up" runat="server"> <ContentTemplate>ÎÞˢл·¾³ÖУº
Response.Write("<script>alert('¹§Ï²Äú£¬Òѳɹ¦¼ÓÈëµ½ÄúµÄÈ˲ſ⣡');</script>");
ÔÚÓÐ<asp:UpdatePanel ID="up" runat="server"> <ContentTemplate>ÎÞˢл·¾³Ö ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
¡¡¡¡2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1 ......
<system.web>
<!--********³ö´íÒ³µÄÉ趨********-->
<customErrors mode="On" defaultRedirect="~/Error.htm"> </customErrors> ......
Asp.NetÖÐÓÐÒ»Ì×ÓëÓû§Ïà¹ØÁªµÄÊôÐÔÉèÖ㬿ÉÒÔͨ¹ýÔÚWebConfigÀïÅäÖÃÀ´Ö±½ÓʹÓã¬ËûµÄ×÷ÓÃΪ
´æ´¢ºÍʹÓÃΨһÓëÓû§¶ÔÓ¦µÄÐÅÏ¢
Õ¹ÏÖ¸öÈË»¯°æ±¾µÄWebÓ¦ÓóÌÐò
Óû§µÄΨһÉí·Ý±êʶÔÚÔٴηÃÎÊʱʶ±ðÓû§
Asp.Net ProfileÌṩµÄ¸úÓû§Ïà¹ØµÄÀàÐͶ¼ÊÇÇ¿ÀàÐÍ
Ê×ÏÈÉú³ÉÊý¾Ý¿â½Å±¾£¬Ê¹ÓÃVisual Studio 2005 ÃüÁîÌáʾ£¬ÊäÈë ......