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

Asp.Net 4.0 ÐÂÌØÐÔ ÏµÁÐ Ö®Ò» ´ÓÒ³Ãæ±ê¼Ç˵Æð

VS2010ÔÚ4Ô·ÝÒѾ­Õýʽ·¢²¼ÁË£¬Asp.Net 4.0¸øÎÒ´øÀ´ÁËһЩеĶ«Î÷¡£ÌåÑéÒ»°Ñ¡£
1. ´ÓÒ³Ãæ±ê¼Ç<%%>˵Æð
2. Asp.Net 4.0 ÖпÉÒÔÓÃ×Ô¶¨ÒåµÄProvider×öOutputCache ÁË
3. SEOÔöÇ¿Ö§³ÖMetaKeywords£¬ºÍMetaDescription£¬RedirectPermanant
4. SEOÔöÇ¿Ö®URL Routing
5. Êä³ö¸ü´¿¾»µÄHtml´úÂ룬ViewStateModeºÍClientIDMode,CheckBoxListµÈ
6. Asp.Net 4.0 ·á¸»µÄͼ±í¿Ø¼þ
7. ÔÚAsp.Net4.0ÖÐʹÓÃJqueryµÄAjax
8. ×Ô¶¯²¿Êð¹¦ÄÜÔöÇ¿
ÔÚAsp.Net4.0ÖÐ<%·ûºÅ±í´ïʽ%>ÓÐËÄÖÖÐÎʽ£¬·Ö±ðΪ<%=”hello world”%>,<%$expression%>,<%#expression%>£¬<%:abc%> ÎÒÃÇ·Ö±ðÀ´¿´Ò»ÏÂ
 1£® <%=±í´ïʽ%> ÕâÖÐд·¨Ö§³Öasp£¬jspµÈµÈ£¬Ëû¾ÍÊÇÖ±½ÓÊä³ö±í´ïʽµÄÖµ£¬ËüµÈͬÓÚ
 
Response.Write(±í´ïʽ);
2£® <%$declarationExp:expression%> ÕâÊÇÒ»ÖÖÉùÃ÷ʽ±í´ïʽ£¬ËûÔÚAsp.Net 2.0ʱ±»ÒýÈ룬ÎÒÃÇ¿ÉÒÔÀûÓÃÕâ¸ö±í´ïʽ£¬Êä³öAppSettingsÖеÄÅäÖ㬸øSqlDataSource¿Ø¼þÉ趨Á¬½Ó×Ö·û´®µÈµÈ£¬ÔÚ.Net 4.0ʱÎÒÃÇ¿ÉÒÔÔÚÕâ¸ö±í´ïʽÖÐÊä³öUrl RoutingÖеIJÎÊýÖµ£¬»òÕ߸ù¾ÝÉèÖõõ½UrlRoutingºóµÄURL
ÀýÈ磺
1£©ÔÚLiteralÖÐÏÔʾURL Routing µ±Ç°µÄactionÖµ
<asp:Literal ID="l" EnableViewState="false" Text="<%$RouteValue:action %>" runat="server"></asp:Literal>
2£©´«Èë²ÎÊýÏÔʾRoutingºóµÄUrl
<asp:Label ID="lb" EnableViewState="false" Text="<%$RouteUrl:controller=Category ,action=edit,id=1%>" runat="server"></asp:Label>
ÔÚ.Net 4.0Ö§³ÖµÄϵͳĬÈÏÖ§³ÖµÄ±í´ïʽÓУºResources, ConnectionStrings,AppSettings,RouteUrl,RouteValueÕâЩÔÚ¸ùÅäÖÃÎļþweb.configµÄsystem.web/compilation/expressionBuildersÅäÖýÚÖÐÓÐÅäÖÃ
¸ü¶à½éÉÜ¿ÉÒԲο¼£ºhttp://msdn.microsoft.com/en-us/library/d5bd1tad(v=VS.100).aspx
http://msdn.microsoft.com/en-us/library/system.web.compilation.routeurlexpressionbuilder.aspx
3£® <%#expression%>±íʾÊý¾Ý°ó¶¨£¬±ØÐëÔÚµ÷ÓÃDataBind·½·¨²ÅÄÜÊä³ö°ó¶¨µÄÖµ£¬Í¨³£ÓÃÔÚDataGrid£¬Repeater£¬ListViewµÈÄ£°å¿Ø¼þÖС£
4£® <%:expression%>ËüÊÇÒ»¸öÐÂÔöµÄ±í´ïʽ·½Ê½£¬±íʾ½«expression HtmlEncodeºóÊä³ö£¬Èç¹ûÕâ¸ö±í´ïʽµÄÀàÐÍʱIhtmlString£¬Ëü½«Í¨¹ýIhtmlString½Ó¿ÚµÄToHtmlString()·½·¨À´×öUrlEnco


Ïà¹ØÎĵµ£º

Asp.net ÌìÆøÔ¤±¨×ÊÁÏÕûÀí ³õ¸å

ASP.NET»ñÈ¡ÌìÆøÔ¤±¨´óÖ·ÖÎöÓÐ 1µ½Ä³¸öÍøÕ¾ÉÏ·ÖÎöÍøÕ¾µÄ´úÂë»ñÈ¡£»2×Ô¼ºÐ´Çý¶¯·þÎñºÍweb·þÎñ  µÚ¶þÖÖˮ̫Éî²»ÔøÉæ¼°¡£
ASP.NETºǫ́³ÌÐò»ñÈ¡ÖÐÑëÆøÏǫ́ÌìÆøÔ¤±¨
1.ÌìÆø·â×°³ÉÒ»¸öʵÌå
2.¿ÉÒÔ»ñÈ¡µ±ÌìÌìÆø£¬Ò²¿ÉÒÔ»ñȡδÀ´ÎåÌìµÄÌìÆø¼¯ºÏ
using System;
using System.Collections.Generic;
using System.Text;
......

ASP.NETʹÓÃRequest»ñÈ¡À´Ô´ÍøÖ·URL²ÎÊý

Request¶ÔÏó¹¦ÄÜÊÇ´Ó¿Í»§¶ËµÃµ½Êý¾Ý£¬³£ÓõÄÈýÖÖÈ¡µÃÊý¾ÝµÄ·½·¨ÊÇ£ºRequest.Form¡¢Request.QueryString£¬Request¡£ÆäµÚÈýÖÖÊÇÇ°Á½ÖÖµÄÒ»¸öËõд£¬¿ÉÒÔÈ¡´úÇ°Á½ÖÖÇé¿ö¡£¶øÇ°Á½ÖÖÖ÷Òª¶ÔÓ¦µÄFormÌύʱµÄÁ½ÖÖ²»Í¬µÄÌá½»·½·¨£º·Ö±ðÊÇPost·½·¨ºÍGet·½·¨¡£
        Request ¶ÔÏóµÄÊôÐԺͷ½·¨± ......

ASP.NETÖÐÈçºÎʵÏÖFORMÈÏÖ¤µÇ¼

ÈçºÎÔËÓà Form ±íµ¥ÈÏÖ¤
ASP.NET µÄ°²È«ÈÏÖ¤£¬¹²ÓГWindows”“Form”“Passport”“None”ËÄÖÖÑé֤ģʽ¡£“Windows”Óë“None”ûÓÐÆðµ½±£»¤µÄ×÷Ó㬲»ÍƼöʹÓ㻓Passport”ÎÒÓÖûÓùý£¬°¦……ËùÒÔÎÒÖ»ºÃ½²½²“Form”ÈÏ ......

ÔÚasp.netÀïÔõô¸ù¾ÝÓû§È¨ÏÞÀ´Éú³ÉÊ÷Ðβ˵¥

ÔÚasp.netÀïÔõô¸ú¾ÝÓû§È¨ÏÞÀ´Éú³ÉÊ÷Ðβ˵¥
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;
......

ÓÃAsp.netÖÆ×÷¶¥²¿µ¼º½¿Ø¼þ

Ò»¡¢Ð§¹û¼ò½é
¡¡¡¡µ±µã»÷Ò»¼¶À¸Ä¿Ê±£¨ÈçÊ×Ò³£©£¬±»µã»÷µÄÒ»¼¶À¸Ä¿µÄµ¥Ôª¸ñ±³¾°É«·¢Éú±äÉ«£¬Èç¹û¸ÃÒ»¼¶À¸Ä¿ÏÂÓжþ¼¶À¸Ä¿£¬Ôò»áÔÚÏÂÒ»ÐÐÏÔʾ³öÀ´£¬·ñÔò¶þ¼¶À¸Ä¿ÕâÒ»Ðв»»áÏÔʾÈκζ«Î÷£¬µ«»áÕ¼Ò»¶¨µÄ¸ß¶È¡£µ±µã»÷¶þ¼¶À¸Ä¿Ê±£¬ÆäËùÊôµÄÒ»¼¶À¸Ä¿µ¥Ôª¸ñ±³¾°É«·¢Éú±ä»¯£¬Í¬Ê±±»µã»÷µÄ¶þ¼¶À¸Ä¿Ãû³Æ»á¼Ó´Ö£¬²¢ÔÚÇ°·½¼ÓÒ»¸ö“¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ