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

´´½¨×Ô¶¨ÒåHTML Helper

´Ë½Ì³ÌÏòÄãÑÝʾÈçºÎÔÚÄãµÄMVCÊÓͼÀï´´½¨×Ô¶¨ÒåHTML Helper¡£ÀûÓà HTML Helpers, ¿ÉÒÔ¼õÉÙ·¦Î¶µÄÊäÈëHTML±êÇ©¡£
Ôڽ̵̳ĵÚÒ»²¿·Ö£¬ÎÒÃèÊöÁËASP.NET MVC¿ò¼ÜÒÑÓеÄHTML Helper¡£È»ºó£¬ÎÒÃèÊöÁË´´½¨×Ô¶¨ÒåHTML HelperµÄÁ½¸ö·½·¨£ºÎÒ»á½âÊÍÈçºÎͨ¹ý´´½¨¾²Ì¬·½·¨ºÍÀ©Õ¹·½·¨À´´´½¨HTML Helper¡£
Àí½â HTML Helper
HTML Helper Ö»ÊÇÒ»¸ö·µ»Ø×Ö·û´®µÄ·½·¨¡£Õâ¸ö×Ö·û´®¿ÉÒÔ±íʾÄãÏëÒªµÄÈκÎÄÚÈÝ¡£ÀýÈ磬Äã¿ÉÒÔʹÓÃHTML HelperÀ´³ÊÏÖ±ê×¼µÄHTML±êÇ©Èç HTML <input> ºÍ <img> ±êÇ©¡£Ä㻹¿ÉÒÔÓÃHTML HelperÀ´³ÊÏÖ¸ü¶à¸´ÔÓÄÚÈݱÈÈçÒ»¸ö±êÇ©Ò³»òÕßÒ»¸öÊý¾Ý¿âÊý¾ÝµÄHTML±í¸ñ¡£
ASP.NET MVC ¿ò¼Ü°üÀ¨ÁËÒÔϱê×¼µÄHTML Helpers (´ËÁÐ±í²¢²»ÍêÕû):
Html.ActionLink()
Html.BeginForm()
Html.CheckBox()
Html.DropDownList()
Html.EndForm()
Html.Hidden()
Html.ListBox()
Html.Password()
Html.RadioButton()
Html.TextArea()
Html.TextBox()
ÀýÈç, ¿¼ÂÇ´úÂë1µÄ±íµ¥¡£´Ë±íµ¥ÓÉÁ½¸ö±ê×¼HTML Helper³ÊÏÖ£¨¼ûͼ1£©¡£´Ë±íµ¥Óà Html.BeginForm() ºÍHtml.TextBox() Helper ·½·¨À´³ÊÏÖÒ»¸ö¼òµ¥µÄHTML±íµ¥¡£

ͼ01: ÓÉHTML Helper³ÊÏÖµÄÒ³Ãæ (µã»÷²é¿´ÍêÕû´óС)
´úÂë1 – Views\Home\Index.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="MvcApplication1.Views.Home.Index"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head id="Head1" runat="server">
<title>Index</title>
</head>
<body>
<div>
<% using (Html.BeginForm())
{ %>
<label for="firstName">First Name:</label>
<br />
<%= Html.TextBox("firstName")%>
<br /><br />
<label for="lastName">Last Name:</label>
<br />
<%= Html.TextBox("lastName")%>
<br /><br />
<input type="submit" value="Register" />


Ïà¹ØÎĵµ£º

µ¥ÒýºÅ,Ë«ÒýºÅ,javascript,HTML,תÒå×Ö·û

ÔÚÒ»¸öÍøÒ³Öеİ´Å¥£¬Ð´onclickʼþµÄ´¦Àí´úÂ룬²»Ð¡ÐÄд³ÉÈçÏ£º
<input value="Test" type="button" onclick="alert(""OK"");" />
IEÌáʾ³ö´íºó£¬ÔÙÂþ²»¾­ÐĵظÄΪ£º
<input value="Test" type="button" onclick="alert(\"OK\");" />
½á¹û»¹Êdzö´í¡£
Õâʱ£¬ÎÒ¾ÍÏ벻ͨÁË£¬ËäÈ»ÎÒÖªµÀ×îÖ±½ÓµÄ½â¾ö·½·¨ ......

»ñÈ¡URL¶ÔÓ¦µÄHTMLÎĵµ¼°ÓÃÕýÔò×öreplace

        System.Net.WebRequest request = System.Net.WebRequest.Create("http://la.jmw.com.cn/c.asp");
        request.UseDefaultCredentials = false;
        System.Net.WebResponse response = requ ......

ÖÆ×÷HtmlÒ³Ãæ¹æ·¶ºÍ×¢ÒâÊÂÏî

1.ΪҳÃæÌí¼ÓÕýÈ·µÄ DOCTYPE
XHTML1.0 ÌṩÁËÈýÖÖ DOCTYPE ¿ÉÑ¡Ôñ£º  
1.¹ý¶ÉÐÍ(Transitional)--ÆÕ±é 
<!DOCTYPE  html  PUBLIC  "-//W3C//DTD  XHTML  1.0
Transitional//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
2.Ñ ......

IText Éú³Értf ÄÚÈÝÖк¬ÓÐHTML±êÇ©´¦Àí

import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.StringReader;
import java.util.List;
import com.lowagie.text.Document;
import com.lowagie.text.PageSize;
import com.lowagie.text.Paragraph;
import com.lowagie.text.html.simpleparser.HTMLWorker;
import com.lowagie.te ......

HTMLÒ»ÖÖÊó±êÒƶ¯ÁбäɫЧ¹û

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title> ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ