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

ÀûÓÃASP.NET¼¼Êõ¶¯Ì¬Éú³ÉHTMLÒ³Ãæ

ÎÄÕ³ö´¦£ºhttp://hi.baidu.com/richiezheng/blog/item/8bb94b8692315b3867096efa.html
ÀûÓÃASP.NET¼¼Êõ¶¯Ì¬Éú³ÉHTMLÒ³Ãæ
˼·
¡¡¡¡1. ÀûÓÃÈçDw-MxÕâÑùµÄ¹¤¾ßÉú³Éhtml¸ñʽµÄÄ£°å£¬ÔÚÐèÒªÌí¼Ó¸ñʽµÄµØ·½¼ÓÈëÌØÊâ±ê¼Ç(Èç$htmlformat$),¶¯Ì¬Éú³ÉÎļþʱÀûÓôúÂë¶ÁÈ¡´ËÄ£°å£¬È»ºó»ñµÃǰ̨ÊäÈëµÄÄÚÈÝ£¬Ìí¼Óµ½´ËÄ£°åµÄ±ê¼ÇλÖÃÖУ¬Éú³ÉÐÂÎļþÃûºóдÈë´ÅÅÌ£¬Ð´ÈëºóÔÙÏòÊý¾Ý¿âÖÐдÈëÏà¹ØÊý¾Ý¡£
¡¡¡¡2. ʹÓúǫ́´úÂëÓ²±àÂëHtmlÎļþ£¬¿ÉÒÔʹÓÃHtmlTextWriterÀàÀ´Ð´htmlÎļþ¡£
¡¡¡¡Óŵã
¡¡¡¡1. ¿ÉÒÔ½¨Á¢·Ç³£¸´ÔÓµÄÒ³Ãæ£¬ÀûÓðüº¬jsÎļþµÄ·½·¨£¬ÔÚjsÎļþÄÚ¼ÓÈëdocument.write()·½·¨¿ÉÒÔÔÚËùÓÐÒ³ÃæÄÚ¼ÓÈëÈçÒ³ÃæÍ·£¬¹ã¸æµÈÄÚÈÝ¡£
¡¡¡¡2. ¾²Ì¬htmlÎļþÀûÓÃMS Windows2000µÄIndex Server¿ÉÒÔ½¨Á¢È«ÎÄËÑË÷ÒýÇæ£¬ÀûÓÃasp.net¿ÉÒÔÒÔDataTableµÄ·½Ê½µÃµ½ËÑË÷½á¹û¡£¶øWin2000µÄIndex·þÎñÎÞ·¨²éÕÒxmlÎļþµÄÄÚÈÝ¡£Èç¹û°üÀ¨ÁËÊý¾Ý¿âËÑË÷ÓëIndexË÷ÒýË«ÖØ²éÕÒ£¬ÄÇô´ËËÑË÷¹¦Äܽ«·Ç³£Ç¿´ó¡£
¡¡¡¡3. ½ÚÊ¡·þÎñÆ÷µÄ¸ººÉ£¬ÇëÇóÒ»¸ö¾²Ì¬µÄhtmlÎļþ±ÈÒ»¸öaspxÎļþ·þÎñÆ÷×ÊÔ´½ÚÊ¡Ðí¶à¡£
¡¡¡¡È±µã
¡¡¡¡Ë¼Â·¶þ£º Èç¹ûÓÃÓ²±àÂëµÄ·½Ê½£¬¹¤×÷Á¿·Ç³£´ó£¬ÐèÒª·Ç³£¶àµÄhtml´úÂë¡£µ÷ÊÔÀ§ÄÑ¡£¶øÇÒʹÓÃÓ²±àÂëÉú³ÉµÄhtmlÑùʽÎÞ·¨Ð޸ģ¬Èç¹ûÍøÕ¾¸ü»»Ñùʽ£¬ÄÇô±ØÐëµÃÖØÐ±àÂ룬¸øºóÆÚ´øÀ´¾Þ´óµÄ¹¤×÷Á¿¡£
¡¡¡¡Òò´ËÕâÀï²ÉÓõÄÊǵÚÒ»ÖÖ˼·
¡¡¡¡Ê¾ÁдúÂë
¡¡¡¡1.¶¨Òå(template.htm)htmlÄ£°åÒ³Ãæ
<html>
<head>
<title>www.knowsky.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body >
<table $htmlformat[0] height="100%" border="0" width="100%" cellpadding="10" cellspacing="0" bgcolor="#eeeeee" style="border:1px solid #000000">
<tr>
<td width="100%" valign="middle" align="left">
<span style="color: $htmlformat[1];font-size: $htmlformat[2]">$htmlformat[3]</span>
</td>
</tr>
</table>
</body>
</html>
¡¡¡¡2.asp.net´úÂ룺
//---------------------¶ÁhtmlÄ£°åÒ³Ãæµ½stringbuilder¶ÔÏóÀï----
string[] format=new string[4];//¶¨ÒåºÍhtmlyem±ê¼ÇÊýĿһÖµÄÊý×é
StringBuilder htmltext=new StringBuilder();
try
{
¡¡using (StreamReader sr = new StreamReader("´


Ïà¹ØÎĵµ£º

ASP.NET MVC½éÉÜ

The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications. The ASP.NET MVC framework is ......

ASP.NETÖг£ÓõÄÈýÊ®ÈýÖÖ´úÂë


 1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
response.write("£¼script£¾window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')£¼/script£¾")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1.Attribute ......

ASP.NET·ÀÖ¹SQL×¢È뺯Êý

ASP.NET·ÀÖ¹SQL×¢È뺯Êý:
using System;
using System.Text.RegularExpressions;
using System.Web;
namespace FSqlKeyWord
......{
    /**//**//**//// <summary>
    /// SqlKey µÄժҪ˵Ã÷¡£
    /// </summary>
    public class S ......

asp.netµÄÔÚÏßÈËÊýͳ¼Æ

Ò»°ãÊÇ·ÅÔÚGlobal.asaxÖУ¬´úÂëÈçÏ£º
<%@ Application Language="C#" %>
<mce:script runat="server"><!--
void Application_Start(object sender, EventArgs e)
{
// ÔÚÓ¦ÓóÌÐòÆô¶¯Ê±ÔËÐеĴúÂë
//Application["online"] = 10;//ÉèÖÃĬÈÏÔÚÏßÈËÊý,ÔÚÐéÄâ¿Õ¼äÉÏ£¬ÕâÀï²»»á ......

asp.net ÊüÕÖ²ãÉÏ´«Í¼Æ¬(¶þ½øÖÆ),²¢ÏÔʾ¶þ½øÖÆÍ¼Æ¬

1.ÉÏ´«¹¦ÄÜ
JS¼ì²é
function hideUpImg()//¹Ø±Õ²ã£¬²¢ÉÏ´«Í¼Æ¬
{
var v=document.getElementById("upImg").value;
var after=v.substring(v.lastIndexOf('.')).toLowerCase();
alert(after);
if(v.length<=0)
{
alert("ÇëÑ¡ÔñͼƬ");
return ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ