ASP.net:Literal¿Ø¼þÓ÷¨
¸Õ¿ªÊ¼Ñ§.NETµÄÅóÓÑ¿ÉÄܲ»Çå³þLiteralºÍLabelµ½µ×ÓÐʲôÇø±ð,ÆäʵËüÃÇÒ²Ö»ÓÐÒ»¸öÇø±ð,¾ÍÊÇÔÚת»»³É¿Í»§¶ËHtml´úÂëºó,Label¾Í³ÉÁË<span></span>,¶øLiteralÔòÊÇʲô±ê¼Ç¶¼²»´ø,ÏÂÃæ½øÈëÕýÌâ:
×òÌì×öÒ»¸öÍøÕ¾µÄÊÓƵÐÂÎŹÜÀí,Ê×ÏÈÎÒÒªÔÚÒ³ÃæÀïÌí¼ÓÒ»¸ö²¥·ÅÆ÷,ÈçÏÂ:
1<OBJECT height=288 width=384 classid=clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa VIEWASTEXT>
2 <PARAM NAME="_ExtentX" VALUE="10160"><PARAM NAME="_ExtentY" VALUE="7620">
3 <PARAM NAME="AUTOSTART" VALUE="-1"><PARAM NAME="SHUFFLE" VALUE="0">
4 <PARAM NAME="PREFETCH" VALUE="0"><PARAM NAME="NOLABELS" VALUE="0">
5 <PARAM NAME="SRC" VALUE="<asp:Literal id='lt_src' runat='server'></asp:Literal>">
6 <PARAM NAME="CONTROLS" VALUE="imagewindow"><PARAM NAME="CONSOLE" VALUE="clip1">
7 <PARAM NAME="LOOP" VALUE="0"><PARAM NAME="NUMLOOP" VALUE="0"><PARAM NAME="CENTER" VALUE="0">
8 <PARAM NAME="MAINTAINASPECT" VALUE="0"><PARAM NAME="BACKGROUNDCOLOR" VALUE="#000000">
9 </OBJECT>
ÄÇôÈçºÎÈÃÕâ¸ö²¥·ÅÆ÷Äܸù¾ÝÎÒÃÇ´«µÄ²ÎÊý²»Í¬¶ø²¥·Å²»Í¬µÄÄÚÈÝÄØ?ÉÏÃæÒ»¶ÎHtml´úÂëµÄµÚ5ÐоÍÖ¸Ã÷ÁËÕâ¸ö²¥·ÅÆ÷²¥·ÅµÄÄÚÈÝÀ´Ô´,ΪÁËʵÏÖÄܸù¾Ý²ÎÊý²»Í¬²¥·Å²»Í¬µÄÄÚÈÝ,ÎÒÃǽ«ÆäValueÖµÉèÖÃΪһ¸öLiteral¿Ø¼þ,È»ºóÔÚºóÖôúÂëÖж¯Ì¬µÄ¶ÔLiteralµÄT
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
1¡¢ÔÚcompilation Ï£¬ÇëÉèÖÃdebug=false £¬ÈçÏ£º
default Language="c#" debug="false">
2¡¢ÇëʹÓÃServer.Transfer´úÌæResponse.Redirect¡£
3¡¢Ê¹ÓÃValidator¿Ø¼þ£¬ÇëÒª¾³£¼ì²éPage.IsValid¡£
4¡¢ÇëʹÓÃforeachÑ»·£¬¶ø²»ÊÇΪ×Ö·û´®µü´úÑ»·¡£
5¡¢ÇëʹÓÿͻ§¶ËÑéÖ¤·½Ê½(²»ÒªÃ¿´Î¶ ......
»¶ÓÅÄש£¬¹²Í¬½ø²½£¡£¡£¡
1¡¢ÔÚcompilation Ï£¬ÇëÉèÖÃdebug=false £¬ÈçÏ£º
default Language="c#" debug="false">
2¡¢ÇëʹÓÃServer.Transfer´úÌæResponse.Redirect¡£
3¡¢Ê¹ÓÃValidator¿Ø¼þ£¬ÇëÒª¾³£¼ì²éPage.IsValid¡£
4¡¢ÇëʹÓÃforeachÑ»·£¬¶ø²»ÊÇΪ×Ö·û´®µü´úÑ»·¡£
5¡¢ÇëʹÓÿͻ§¶ËÑéÖ¤ ......
Ê×ÏÈÔÚÓ¦ÓóÌÐòµÄWEB.CONFIGÐÞ¸ÄÈçϽڵ㡣
<httpHandlers>
<add verb="*" path="*.html" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>
<assemblies>
<buildProviders>
<add ext ......
JS´úÂë:
<script type="text/javascript" languag ......