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

ASP.NET½Ì³Ì:URLÖØдµÄʵÏÖ

×î½üÓиöÅóÓÑÒª×öurlÖØдµÄ¶«Î÷,ÎÒ°ïËûŪÁËŪ,»ØÍ·¿´µ±Äê×Ô¼ºÐ´µÄÄǸöÎÄÕÂ,µ±Ê±ÒÔΪ×Ô¼ºÐ´µÄºÜÈÝÒ×Àí½â.µ«ÏÖÔÚÔÙ¿´È´¾õµÃдµÄ²»ºÃ.¶ø½ñÌì°Ù¶ÈÁËÒ»ÏÂurlrewriter·¢ÏÖÎÒÕâ¸öÎÄÕ¾¹È»Åŵڶþ.ΪÁË·½±ã¸ü¶àÅóÓÑ,ÎÒÔÙдµã¶«Î÷²¹³äÏÂ.
Ò»°ãÓðٶÈËѵÄÅóÓѶ¼ÊǶÔÕâ¸ö²»Á˽⵫ÓÖ¼±ÐèÒªÓõÄ,ÎÒÏë,ÔÙ¶àµÄÓïÑÔÒ²±È²»¹ýÒ»¾ä´úÂë.ÓÚÊÇÎҰѽñÌì°ïÅóÓÑʱºòдµÄÒ»¸öСÀý×Ó´«ÁËÉÏÀ´.Õâ¸öСÀý×ÓµÄÄ¿µÄÊÇʵÏÖ¶ÔÈÎÒâurlµÄÖØд(µ«²»°üÀ¨¶þ¼¶ÓòÃûµÄ,ÓÐÐèÒª¶þ¼¶ÓòÃûµÄÒ²¿ÉÒÔÏÈÁ˽âÏÂurlÖØдµÄ¸ÅÄî). Õâ¸öСÏîÄ¿µÄÖÆ×÷¹ý³ÌÈçÏÂ
ÐèÒª¶ÔÖîÈçhttp://song2.cn/viewnews/2009/3/2.htmlµÄurl½øÐÐÖØд.½«ÆäÖØдΪhttp://song2.cn/viewnews.aspx?id=2&year=2009&month=3
ÏÂÔØ΢ÈíµÄÄǸöURLRewriter.dll,ʹÓÃÕâ¸ö¶Ôurl½øÐÐÖØд.
ÎÒÃÇÀ´¿´Õâ¸öurl, http://song2.cn/viewnews/2009/3/2.html(µ±È»Ò²¿ÉÄÜÊÇ3.html,6.html,7.html).ÒªÖØд,Ê×ÏÈÊǽػñurlÇëÇó,È»ºó·ÖÎöµ±Ê±µÄurl,×îºóÌøתµ½ÏàÓ¦µÄÒ³Ãæ.ËùÒÔÎÒÃǵÚÒ»²½ÊÇÒª½Ø»ñurlÇëÇó.Ϊ´Ëн¨Ò»¸öÀà¿â½ÐURL,ÔÚ¸ÃÀà¿âÖÐÒýÓÃURLRewriter.dll.н¨Ò»¸öÀàmyrewritter.cs,´úÂëÈçÏÂ
namespace URL
{
    public class myrewritter : URLRewriter.BaseModuleRewriter
    {
        protected override void Rewrite(string requestedPath, HttpApplication app)
        {
            if (requestedPath.Contains("viewnews/2009/3/2.html"))
                app.Context.RewritePath("/viewnews.aspx?id=2&year=2009&month=3");
            else
                app.Context.RewritePath("/here.aspx");
        }
    }
}
¿ÉÒÔ¿´µ½¸ÃÀà¼Ì³ÐÁËURLRewriter.BaseModuleRewriter,È»ºóÔÚRewrite·½·¨ÖмÓÈëÁËÎÒÃÇ×Ô¼ºµÄÂß¼­.ÏÖÔÚ,Ö»Òªµ±Ç°µÄurlÇëÇóÊÇviewnews/2009/3/2.html,ÎÒÃǾͻὫҳÃæÖØдµ½/viewnews.aspx?id=2&year=2009&month=3.
ÕâÖ»ÊÇÒ»¸ö¼òµ¥µÄÀý×Ó,


Ïà¹ØÎĵµ£º

C# ASP.NET »ñÈ¡½Å±¾Óï¾ä²¢ÓÃÎı¾µÄ·½Ê½ÏÔʾ³öÀ´

protected void Button6_Click(object sender, EventArgs e)
    {
        this.Label11.Text = HtmlEncode(this.TextBox3.Text);
 
       
    }
    protected static string HtmlEn ......

asp.net ³ÌÐò×Ô¶¯Ìá½»µÇ½±íµ¥²¢±£³ÖSession¼°Cookie

1¡¢Í¨¹ý¸½¼ÓÒ»¸öcookiecontainerµ½httprequest¶ÔÏóÖУ¬¿ÉÒԵõ½µÇ¼ºó·µ»ØµÄ´ú±íSESSION IDµÄCOOKIE¡£
2¡¢½«´ËCOOKIE°üº¬ÔÚÒ»¸öcookiecontainerÖв¢¸½¼Óµ½ÁíÒ»¸öHTTPREQUESTÇëÇóÖУ¬Ôò¿ÉÒÔʵÏÖSESSIONµÄ»¹Ô­¡£
²¿·ÖÖ÷Òª´úÂ룺
        CookieContainer cookieContainer =& ......

Asp.net»Ø³µÄ¬ÈÏ°´Å¥Ê¼þ½â¾ö·½°¸


Ò»¡¢
Js
ÉèÖÃĬÈÏ°´Å¥
       
function
document.onkeydown()
       
{
           
var
e=event
.srcElement;
        &nbs ......

asp.net¼òµ¥Êý×ÖÑéÖ¤ÂëµÄʵÏÖ

µ÷ÓÃ
ÑéÖ¤Â룺<input type="text" id="txtValidate" style="border: solid 1px #9B9B9B; width: 85px;
height: 17px;" />  <img src="Rnd.aspx" mce_src="Rnd.aspx" style="width: 58px; height: 17px;
border: solid 1px #9B9B9B" align="abs ......

asp.net ÊÂÎñÀý×Ó

protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection conn;
SqlCommand cmd1, cmd2;
SqlTransaction tra;
conn = new SqlConnection("server=.;database=test;uid=sa;pwd=123");
conn.Open();
tra = conn.BeginTransaction();//¿ªÊ¼ÊÂÎ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ