ASP.NET Literal¿Ø¼þÓ÷¨
ASP.NET Literal¿Ø¼þÓ÷¨_»ªÎª½ðÉ½Íø
ÔÚÄúÒªÒÔ±à³Ì·½Ê½ÉèÖÃÎı¾¶ø²»Ìí¼Ó¶îÍâµÄ HTML ±ê¼Çʱ£¬¿ÉÒÔÏòÒ³ÃæÌí¼Ó Literal Web ·þÎñÆ÷¿Ø¼þ¡£ÔÚÒªÏòÒ³Ãæ¶¯Ì¬Ìí¼ÓÎı¾¶ø²»Ìí¼ÓÈκβ»ÊôÓڸö¯Ì¬Îı¾µÄÔªËØÊ±£¬Literal ¿Ø¼þ·Ç³£ÓÐÓá£ÀýÈ磬Äú¿ÉÒÔʹÓà Literal ¿Ø¼þÀ´ÏÔʾ´ÓÎļþ»òÁ÷ÖжÁÈ¡µÄ HTML¡£
×¢Òâ
Èç¹ûÒªÏÔʾ¾²Ì¬Îı¾£¬Ôò¿ÉÒÔʹÓà HTML ³ÊÏÖËü£»²»ÐèÒª Literal ¿Ø¼þ¡£Ö»ÓÐÔÚÐèÒªÒÔ±à³Ì·½Ê½³ÊÏÖÎı¾Ê±²ÅʹÓà Literal ¿Ø¼þ¡£
Ïò Web ´°ÌåÒ³Ìí¼Ó Literal ¿Ø¼þ
½« <asp:Literal> ÔªËØ¼üÈëÒ³Ãæ¡£
ÏÂÃæµÄʾÀýÏÔʾһ¸ö¼òµ¥Ò³£¬¸ÃÒ³ÔÚÔËÐÐʱÏÔʾ±êÌâÐÂÎÅ¡£¸ÃÒ³µÄÖ÷Ì壨°üÀ¨ Literal ¿Ø¼þ£©ÀàËÆÓÚÏÂÃæµÄ´úÂ룺
<body>
<form runat="server">
<h1> <asp:Literal runat=server /> </h1>
</form>
</body>
»òÕߣ¬½« Mode ÊôÐÔÉèÖÃΪ Transform¡¢PassThrough »ò Encode¡£Mode ÊôÐÔÖ¸¶¨¿Ø¼þÈçºÎ´¦ÀíÄúÌí¼Óµ½¸Ã¿Ø¼þÖеıê¼Ç¡£
½«´úÂëÌí¼Óµ½Ò³ÃæÉÏÒÔÔÚÔËÐÐʱÉèÖÿؼþµÄ Text ÊôÐÔ¡£
ÏÂÃæµÄʾÀýÑÝʾÈçºÎÒÔ±à³Ì·½Ê½ÉèÖà Literal ¿Ø¼þµÄÎı¾ºÍ±àÂë¡£¸ÃÒ³°üº¬Ò»×鵥ѡ°´Å¥£¬ÔÊÐíÓû§ÔÚ±àÂëÎı¾ºÍ´«µÝÎı¾Ö®¼äÑ¡Ôñ¡£
×¢Òâ
Èç¹ûÄúÕý½« Text ÊôÐÔÉèÖÃΪÀ´×Ô²»ÊÜÐÅÈÎÔ´µÄÎı¾£¬ÔòÓ¦½«¿Ø¼þµÄ Mode ÊôÐÔÉèÖÃΪ Encode£¬ÕâÑù±ê¼Ç²Å²»»áÐγɿÉÖ´Ðбê¼Ç¡£
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender ,EventArgs e)
{
// Literal1.Text = "This <b>text </b> is inserted dynamically.";
Literal1.Text = " <script language='javascript'>alert('ÄãÖвÊÁË£¡'); <"+"/script>";
if(radioEncode.Checked == true)
{
Literal1.Mode = LiteralMode.Encode;
}
if(radioPassthrough.Checked == true)
{
Literal1.Mode = LiteralMode.PassThrough;
Ïà¹ØÎĵµ£º
×î½üÔÚasp.net Óõ½µÄsqlserver´æ´¢¹ý³Ì·ÖÒ³ÖÐÏÔʾÊý¾ÝʱÓöµ½¹ØÓÚÅÅÐòÎÊÌâ¡£
ÍøÉϵÄһЩ·ÖÒ³´æ´¢¹ý³ÌÖ»Ö§³ÖÅÅÐòÁÐΪint ÀàÐÍ£¬¶ÔÓÚʵ¼Ê¿ª·¢Öкܶàʱºò¶¼ÐèÒª¶ÔDateTimeÀàÐÍ£¬varcharÀàÐͽøÐÐÅÅÐò¡£
ÏÂÃæ·ÖÏíһϿÉÒÔÖ§³ÖÈÎÒâÊý¾ÝÀàÐ͵ÄÁнøÐÐÅÅÐòµÄ´æ´¢¹ý³Ì¡£
Create PROCEDURE sp_viewByPage
@TblName var ......
ÔÚʹÓÃAJAX½øÐгÌÐò¿ª·¢µÄʱºò£¬Ò»Ö±¶¼»áÃæ¶ÔÒ»¸ö»º´æµÄÎÊÌ⣡£¡
¼´ÊÇ£¬ÉÏ´ÎÇëÇóµÄʱºò£¬ÒòΪÄãµÄSQLÓï¾ä»òÕ߯äËûÔÒò£¬webserviceÖзµ»ØÖµÎª¿Õ£¬²»ÊÇÄãÏëÒªµÄ½á¹û¼¯£¬ÔÚÄã·¢ÏÖwebserviceÖÐÓï¾äÌå³ö´íºó£¬½øÐÐÐ޸ģ¬ÖØÐ²âÊÔ£¬ÈÔÈ»ÊÇÉϴεķµ»Ø½á¹û£¡¸Ð¾õ¾ÍÏñÄãµÄÐÞ¸ÄÍêÈ«ÎÞЧ¡£¡£
Æäʵ£¬ÕâÊÇÔÚAJAXµ ......
/// <summary>
/// ¹ýÂ˱ê¼Ç
/// </summary>
/// <param name="NoHTML">°üÀ¨HTML£¬½Å±¾£¬Êý¾Ý¿â¹Ø¼ü×Ö£¬ÌØÊâ×Ö·ûµÄÔ´Âë </param>
/// <returns>ÒѾȥ³ý±ê¼ÇºóµÄÎÄ×Ö</returns>
&nbs ......
Õû¸öSQLºÍAsp.net(vb.net)Ò»Æð´ò°üµÄÈ«¹ý³ÌдһÏ¡£
Ò».×¼±¸±ØÒªµÄÎļþ
1. SQL½Å±¾Îļþ£¬Éú³ÉÒÔºó°²×°¹ý³ÌÖÐÐèÒªµÄ±íºÍ´æ´¢¹ý³ÌµÈµÈ£»
Éú³ÉÖ®ºó£¬¾ÍÔÝʱ°ÑËüÃüÃûΪdb.sql(×¢Òâ´óСд)
2.LisenceFile.rtfµÄ°²×°Îļþ£¬ÒòΪÎÒµÄϵͳÊǸöÈ˵쬶øÇÒfreeµÄ£¬ËùÒÔ¾ÍûÓÐ×ö¡£Õâ¸öÒÔºóÒ²ÊÇÒªÓõ½µÄ¡£
¶þ.ÔÚ×Ô¼ºÏÖÓеÄÏîÄ¿Àïà ......
asp.net¿ª·¢ÖУ¬Í¨³£ÐèÒª×öһЩ¿Í»§¶ËÑéÖ¤¡£µ±ÎÒÃÇĬÈÏÔÚÒ»¸öÒ³ÃæÖмӸöbutton¿Ø¼þʱ£¬Õâ¸öButton±»asp.net Êä³öΪһ¸öSubmit°´Å¥¡£ asp:Button ID=Button1 runat=server Text=Button on click=Button1_Click /
ÔÚ_doPostBack·½·¨ÄÚ£¬Í¨¹ýtheForm.submit()À´Ê¹Êý¾ÝÌá½»µ½·þÎñÆ÷¡£
ÕâÑùºÜÈÝÒ׿´³ö£¬Èç ¹ûÎÒÃÇÏëÒªÔÚÊý¾ÝÌá½ ......