È¥³ýHTML¸ñʽ ½ØÈ¡×Ö·û´®
//½ØÈ¡²¿·ÖÄÚÈÝ·½·¨
public static string strvalue(string value, int length)
{
string strValue = NoHTML(value);// È¥³ýHTML±ê¼Ç
if (strValue.Length > length)
{
return strValue.Substring(0, length) + "...";
}
else
{
return strValue;
}
}
#region »Ø³µ,¿Õ¸ñ¹ýÂË
/**/
/// <summary>
/// È¥³ýHTML±ê¼Ç
/// </summary>
/// <param name="NoHTML">°üÀ¨HTMLµÄÔ´Âë </param>
/// <returns>ÒѾȥ³ýºóµÄÎÄ×Ö</returns>
public static string NoHTML(string Htmlstring)
{
//ɾ³ý½Å±¾
Htmlstring = Regex.Replace(Htmlstring, @"<script[^>]*?>.*?</script>", "",
RegexOpti
Ïà¹ØÎĵµ£º
Ê×ÏÈдһ¸öÒ³Ãæ£¬ÉÏÃæÒª·ÅÒ»¸öButton
<html>
<head>
<title></title>
</head>
<body>
<input id="Button1" type="button" value="button" />
</body>
</html>
½«Æä±£´ ......
´°¿Úʼþ (Window Events)
½öÔÚ body ºÍ frameset ÔªËØÖÐÓÐЧ¡£
ÊôÐÔ Öµ ÃèÊö
onload ½Å±¾ µ±ÎĵµÔØÈëʱִÐнű¾
onunload ½Å±¾ µ±ÎĵµÐ¶ÔØÊ±Ö´Ðнű¾
±íµ¥ÔªËØÊ¼þ (Form Element Events)
½öÔÚ±íµ¥ÔªËØÖÐÓÐЧ¡£
ÊôÐÔ Öµ ÃèÊö
onpropertychange ½Å±¾ µ±Îı¾ÄÚÈݸıäʱִÐнű¾
onchange ½Å± ......
ǰ̨ <form id="form1" runat="server" enctype="multipart/form-data">
<input type="flie" id="xxx">
</form>
ºǫ́ͨ¹ý HttpPostedFile f = Request.Files["xxx"]
½ÓÊվͿÉÒÔÁË ......
StringBuilder sb = new StringBuilder();
Server.Execute("~/Default2.aspx", new StringWriter(sb));
File.WriteAllText(Server.MapPath("index.htm"), sb.ToString()); ......
Zen Coding: Ò»ÖÖ¿ìËÙ±àдHTML/CSS´úÂëµÄ·½·¨
À´Ô´£ºhttp://www.javaeye.com/news/13149
Òë×Ô£ºSmashing Magazine
ÖÐÎÄ£ºZen Coding: Ò»ÖÖ¿ìËÙ±àдHTML/CSS´úÂëµÄ·½·¨
ÔÚ±¾ÎÄÖÐÎÒÃǽ«Õ¹Ê¾Ò»ÖÖеÄʹÓ÷ÂCSSÑ¡ÔñÆ÷µÄÓï·¨À´¿ìËÙ¿ª·¢HTMLºÍCSSµÄ·½·¨¡£ËüÓÉSergey Chikuyonok¿ª·¢¡£
ÄãÔÚдHTML´úÂë(°üÀ¨ËùÓбêÇ©¡¢ÊôÐÔ¡¢ ......