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

Asp.Net 4.0 SEOÔöÇ¿Ö® UrlRouting

ÔÚ.Net 4.0֮ǰÎÒÃÇΪÁË×ö³öËÑË÷ÒýÇæÓѺõģ¬¶ÔÓû§Ò²ÓѺõÄurl¶¼ÊÇÐèÒª×Ô¼ºÊµÏÖUrlÖØд£¬ÏÖÔÚ²»ÐèÒªÁË£¬.Net 4.0ΪÎÒÃÇ×öÕâÒ»ÇС£UrlRoutingÖ®ËùÒÔ³Æ֮ΪRoutingÊÇÒòΪËü²»µ«ÊµÏÖÁËUrlÖØд»¹¿ÉÒÔͨ¹ý²ÎÊýµÃµ½ÖØдºóµÄUrlÔÚÒ³ÃæÉÏʹÓá£
1. Url Routing µÄͨ³£Ó÷¨
UrlRoutingÔÚAsp.Net MvcÏîÄ¿Öб»¹ã·ºÊ¹Óã¬ÔÚMvcÖкܺÃÓã¬ËùÒÔÒÆÖ²µ½ÁËwebformÖУ¬ÎÒÃÇÏÈ¿´ÏÂÔÚwebformÖеÄʹÓ÷½Ê½
¼Ù¶¨Ò»¸öʹÓó¡¾°£ºÎÒÃÇÐèÒª×ö²©¿ÍÿÈÕÎÄÕµÄÒ³Ã棬ÎÒÃÇÏ£ÍûµÄurlµØÖ·ÊÇ£º
/archive/2010/05/10/default.aspx
Õâ¸öµØÖ·½«±»Ó³Éäµ½~/posts.aspxÎļþÉÏ
ҪʹÓÃUrlRouting£¬ÐèÒª½«UrlRoutingµÄ¹æÔò×¢²áµ½RouteTableÖУ¬ÈçÏÂGlobalÎļþÖÐ×¢²áRouting¹æÔòµÄ´úÂë
view source
< id="highlighter_373210_clipboard" title="copy to clipboard" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16" height="16" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" type="application/x-shockwave-flash">
print?
01
public static void RegisterRoutes(RouteCollection routes)
02
{
03
    routes.Ignore("{resource}.axd/{*pathInfo}");
04
  
05
    routes.MapPageRoute("blogs", //¸øÕâ¸öUrlRouting¹æÔòÆðÒ»¸öÃû×Ö
06
        "archive/{year}/{month}/{date}/default.aspx", //Ï£ÍûµÄÓѺÃUrlµØÖ·¸ñʽ
07
        "~/blogs.aspx", //Ó³Éäµ½µÄaspxÒ³Ãæ·¾¶
08
        false, //ÊÇ·ñÐèÒª¼ì²éÓû§È¨ÏÞ
09
        new RouteValueDictionary{ { "year", DateTime.Now.Year },
10
            { "month", DateTime.Now.Month },
11
            {"date", DateTime.Now.Date}
12
        },//²ÎÊýµÄĬÈÏÖµ
13
        new RouteValueDictionary { 
14
         &n


Ïà¹ØÎĵµ£º

asp.net»ñÈ¡´«ÖµgetºÍpostÇëÇó

//postÇëÇó
string name = Request["name"].toString();
string name =Request.Form.Get("name").toString();
//getÇëÇó
string name = Request.QueryString["name"].toString();
µ«ÎÒ·¢ÏÖ ÎÞÂÛÊÇ·ñÊÇpostÓëget´«Öµ¶¼¿ÉÓÃ
string name = Request["name"].toString();

±íµ¥Ìá½»ÖÐgetºÍpost·½Ê½µÄÇø±ð¹éÄ ......

ASP.NET»·¾³µÄÅäÖÃ

½ñÌìÓÃÁË2¸öСʱµÄʱ¼äÀ´ÅäASP.NETµÄ»·¾³£¬ÓÐЩÈË¿ÉÄÜ»áÎÊ£¬ÎªÊ²Ã´ÐèÒªÕâô¾Ã£¬´ð°¸ºÜ¼òµ¥£¬ÒòΪÎÒµÄϵͳÊÇXPÉî¶ÈµÄ~ ËùÒÔ°²×°IISºÜ·Ñ¾¢£¬½ÓÏÂÀ´ÎÒÃèÊöÏÂÎÒÔõô°²×°µÄ¡£
Ç°Ì᣺
1£©ÒѾ­°²×°ÁËVS2008£¬Õâ¸ö³ÌÐòÀïÃæÒѾ­´øÁË.NETµÄFramwork
²½Ö裨һ¶¨Òª¿´ÍêÎÒдµÄÔÙȥŪ£¡£¡£¡£©£º
1£©ÏÖÔÚµÄÈÎÎñÊÇÈ¥ÍøÉÏÏÂÔØÒ»¸öIIS5.Xµ ......

ASP.NET 2.0 Page ¼ÓÔصĹý³Ì

Ö»ÓÐÔÚ¡òPageÖ¸ÁîÖÐÉèÖÃÁË£ºAutoEventWireup="true"£¬·þÎñÆ÷¶ËµÄ±àÒëÆ÷½«°´ÕÕ Page_eventname ·½·¨ÃûµÄÐÎʽ×Ô¶¯µÄ¼ì²éÏàӦʼþ´¦Àí·½·¨£¬×Ô¶¯ÊµÏÖʼþµÄ¶©ÔÄ¡£
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System ......

Ïê½âAsp.net MVC DropDownLists

   Asp.net MVCÖеÄDropDownListsòËÆ»áÈÃÒ»¿ªÊ¼´ÓAsp.net Formsת¹ýÀ´µÄ³ÌÐòÔ±Ôì³É²»ÉÙÃÔ»ó.ÕâƪÎÄÕ½²ÊöÁËΪÁËʹÓÃDropDownLists,ÄãÐèÒªÔÚAsp.Net MVCÖÐÖªµÀµÄ·½·½ÃæÃæ.
   DropDownList,ComboBox,ÎÞÂÛÄãϲ»¶Ôõô³ÆºôÕâЩ£¬ËûÃǺÁÎÞÀýÍâµÄ»á±»Éú³ÉΪhtml select±êÇ©. ÔÚ<select>¿ª±êÇ©ºÍ</ ......

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.Attributes.Add("o ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ