<?xml version="1.0" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="css/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Two Man - SEO与程序员系列</title><link>http://www.blog-design.cn/</link><description>SEO博客,兔漫设计,网站建设 - </description><generator>RainbowSoft Studio Z-Blog 1.8 Arwen Build 81206</generator><language>zh-CN</language><copyright>Copyright 2008 SEO博客 Some Rights Reserved.Two Man兔漫设计 网站备案号:粤ICP备08014898号</copyright><pubDate>Sun, 05 Sep 2010 04:46:34 +0800</pubDate><item><title>Asp.Net程序员与SEO – 301转向</title><author>abcily@126.com (Arain)</author><link>http://www.blog-design.cn/post/154.html</link><pubDate>Thu, 23 Apr 2009 17:13:34 +0800</pubDate><guid>http://www.blog-design.cn/post/154.html</guid><description><![CDATA[<p>在<a target="_blank" href="http://www.blog-design.cn">SEO</a>过程中，301转向往往起着一定的作用。那现在我们来看看asp.net中怎么来设定301转向。</p><p>asp.net 中的一个很简单的转向<br />Response.Redirect(&quot;http://www.blog-design.cn/&quot;); //创建一个302转向到http://www.blog-design.cn/<br />302转向(google能识别)虽然简单明了，对搜索引擎友好度却很差，搜索引擎只将它看作是一个临时的连接转移信息，这意味着它的目标可以改变每一个请求。当你需要转向的时候传递PR值，增加搜索引擎友好度，想把老的网站牵引到新网站的时候，你需要使用301转向。下面做一个简单的代码片段<br />Response.Clear();<br />Response.StatusCode = 301;<br />Response.AppendHeader(&quot;location&quot;, &quot;http://www.blog-design.cn&quot;);<br />Response.End();<br />301转向(或叫301重定向，301跳转)是当用户或搜索引擎向网站服务器发出浏览请求时，服务器返回的HTTP数据流中头信息(header)中的状态码的一种，表示本网页永久性转移到另一个地址。<br />作用就象下图：</p><p>&nbsp;</p><p><img title="" alt="" src="http://www.blog-design.cn/upload/2009/4/301.jpg" onload="ResizeImage(this,520)" /></p>]]></description><category>SEO与程序员系列</category><comments>http://www.blog-design.cn/post/154.html#comment</comments><wfw:comment>http://www.blog-design.cn/</wfw:comment><wfw:commentRss>http://www.blog-design.cn/feed.asp?cmt=154</wfw:commentRss><trackback:ping>http://www.blog-design.cn/cmd.asp?act=tb&amp;id=154&amp;key=878bd70f</trackback:ping></item><item><title>Asp.Net程序员与SEO – 自定义错误页面</title><author>abcily@126.com (Arain)</author><link>http://www.blog-design.cn/post/aspdotnet-seo-errorpage.html</link><pubDate>Thu, 23 Apr 2009 16:46:03 +0800</pubDate><guid>http://www.blog-design.cn/post/aspdotnet-seo-errorpage.html</guid><description><![CDATA[<p>在网站的运行过程中可能会面临很多问题，例如服务器出错，用户请求的页面不存在，程序配置错误等等一系列的问题。在用户请求浏览网页碰到这些的时候会出现一些系统默认的错误页面，这样对于用户很不友好，同时对于搜索引擎来所更是不友好 。</p><p>这里我们认识一些<a target="_blank" href="http://www.blog-design.cn">SEO</a>时常见的Http状态码：</p><p>404：服务器找不到指定的资源，请求的网页不存在(譬如浏览器请求的网页被删除或者移位，但不排除日后该链接有效的可能性)；<br />410：请求的网页不存在(注意：410表示永久性，而404表示临时性)；<br />200：服务器成功返回请求的网页；<br />301：网址永久性重定向<br />302：网址临时性重定向</p><p>在搜索引擎看来最主要的应该是404错误了，404错误是代表网页不存在。当用户进入你域名下一个不存在的页面产生此错误，搜索引擎认为HTTP错误，该页面不存在，如果太多的此类错误将会受到搜索引擎的处罚。<br />解决方案：<br />你可以在IIS处设定404页面。<br />但.net有这更好的做法，在web.config的system.web里面只需要加</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;customErrors defaultRedirect=&quot;404.aspx&quot; mode=&quot;On&quot;&gt;<br />&lt;error statusCode=&quot;404&quot; redirect=&quot;404.aspx&quot;/&gt;<br />&lt;/customErrors&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p><p>在asp.net3.5中可以这么写<br />&lt;customErrors defaultRedirect=&quot;404.aspx&quot; redirectMode=&quot;ResponseRewrite&quot; mode=&quot;On&quot;&gt;<br />&lt;error statusCode=&quot;404&quot; redirect=&quot;404.aspx&quot;/&gt;<br />&lt;/customErrors&gt; <br />如果 RedirectMode 属性设置为 ResponseRedirect，则将用户重定向到该错误页面，并且原始 URL 更改为该错误页面的 URL。如果 RedirectMode 属性设置为 ResponseRewrite，则将用户定向到错误页面，并且不更改浏览器中的原始 URL。<br />这样你就可以自定自己的错误页面啦。</p>]]></description><category>SEO与程序员系列</category><comments>http://www.blog-design.cn/post/aspdotnet-seo-errorpage.html#comment</comments><wfw:comment>http://www.blog-design.cn/</wfw:comment><wfw:commentRss>http://www.blog-design.cn/feed.asp?cmt=153</wfw:commentRss><trackback:ping>http://www.blog-design.cn/cmd.asp?act=tb&amp;id=153&amp;key=ad2e330b</trackback:ping></item><item><title>Asp.Net程序员与SEO - Viewstate优化(二)</title><author>abcily@126.com (Arain)</author><link>http://www.blog-design.cn/post/aspdotnet-seo-viewstate2.html</link><pubDate>Thu, 23 Apr 2009 16:33:07 +0800</pubDate><guid>http://www.blog-design.cn/post/aspdotnet-seo-viewstate2.html</guid><description><![CDATA[<p><span id="fck_dom_range_temp_1240475642242_983">最近有些忙，终于把Asp.net的 Viewstate优化(二) 这里出来。前面的<a target="_blank" href="http://www.blog-design.cn/post/aspdotnet-seo-viewstate.html">Asp.Net程序员与SEO - Viewstate优化( 一 )</a>可能看起来不是很明白，那么我这篇翻译后给大家留个原代码，可以下载下来看看。下面内容接上节开始：</span></p><div style="vertical-align: top"><div style="vertical-align: top">&nbsp;</div><p><span style="font-size: 8.5pt; color: black">我们的网页适配器在这个</span><span style="font-size: 8.5pt; color: black">form</span><span style="font-size: 8.5pt; color: black">的底部添加一个隐藏字段</span><span style="font-size: 8.5pt; color: black">__SEOVIEWSTATE</span><span style="font-size: 8.5pt; color: black">来放</span>实际视图状态数据<span style="font-size: 8.5pt; color: black">，唯一的局限性是你不能直接在</span><span style="font-size: 8.5pt; color: black">asp.net form </span><span style="font-size: 8.5pt; color: black">内的表达式来表现它。</span><span style="font-size: 8.5pt; color: black">然而，这种限制可以很容易地避免把表达的预留位置控制或内部另一个控制。深入解释这一限制看看<a target="_blank" href="http://www.west-wind.com/WebLog/posts/6148.aspx">这篇文章</a></span><span style="font-size: 8.5pt; color: black">。</span></p><p><span style="font-size: 8.5pt; color: black">让我们通过一个例子来看适配器起的作用</span><span style="font-size: 8.5pt; color: black">. </span><span style="font-size: 8.5pt; color: black">下面的</span><span style="font-size: 8.5pt; color: black">ASP.NET page: </span></p><p><b><span style="font-size: 8.5pt; color: black">&lt;</span></b><span style="font-size: 8.5pt; color: #009900">%@ Page </span><span style="font-size: 8.5pt; color: #000066">Language</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;C#&quot;</span><span style="font-size: 8.5pt; color: #000066">AutoEventWireup</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;true&quot;</span><span style="font-size: 8.5pt; color: #000066">CodeBehind</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;Default.aspx.cs&quot;</span><span style="font-size: 8.5pt; color: #000066">Inherits</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;SEOViewStateAdapterTest._Default&quot;</span><span style="font-size: 8.5pt; color: #009900"> %</span><b><span style="font-size: 8.5pt; color: black">&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><span style="font-size: 8.5pt; color: #00bbdd">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span><span style="font-size: 8.5pt; color: #000066"><br /><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;html</span></b><span style="font-size: 8.5pt; color: #000066">xmlns</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;http://www.w3.org/1999/xhtml&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;head</span></b><span style="font-size: 8.5pt; color: #000066">runat</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;server&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;title&gt;&lt;/title&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/head&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;body&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;form</span></b><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;form1&quot;</span><span style="font-size: 8.5pt; color: #000066">runat</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;server&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; Enter a message: </span><b><span style="font-size: 8.5pt; color: black">&lt;br</span></b><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;asp:TextBox</span></b><span style="font-size: 8.5pt; color: #000066">ID</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;txtMessage&quot;</span><span style="font-size: 8.5pt; color: #000066">runat</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;server&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;&lt;/asp:TextBox&gt;&lt;br</span></b><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;asp:Button</span></b><span style="font-size: 8.5pt; color: #000066">ID</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;bSaveMessage&quot;</span><span style="font-size: 8.5pt; color: #000066">runat</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;server&quot;</span><span style="font-size: 8.5pt; color: #000066">Text</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;Save Message&quot;</span><span style="font-size: 8.5pt; color: #000066">onclick</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;bSaveMessage_Click&quot;</span><b><span style="font-size: 8.5pt; color: black">/&gt;&lt;br</span></b><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;asp:Label</span></b><span style="font-size: 8.5pt; color: #000066">ID</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;lMessage&quot;</span><span style="font-size: 8.5pt; color: #000066">runat</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;server&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;&lt;/asp:Label&gt;&lt;br</span></b><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;p&gt;</span></b><span style="font-size: 8.5pt; color: #000066">Page generated at </span><b><span style="font-size: 8.5pt; color: black">&lt;asp:PlaceHolder</span></b><span style="font-size: 8.5pt; color: #000066">ID</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;PlaceHolder1&quot;</span><span style="font-size: 8.5pt; color: #000066">runat</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;server&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;&lt;</span></b><span style="font-size: 8.5pt; color: #009900">%= DateTime.Now.ToString</span><span style="font-size: 8.5pt; color: #66cc66">(</span><span style="font-size: 8.5pt; color: red">&quot;hh:mm dd/MM/yyy&quot;</span><span style="font-size: 8.5pt; color: #66cc66">)</span><span style="font-size: 8.5pt; color: #009900"> %</span><b><span style="font-size: 8.5pt; color: black">&gt;&lt;/asp:PlaceHolder&gt;&lt;/p&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;/div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;/form&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/body&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/html&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp;</span></p></div><div style="vertical-align: top">&nbsp;</div><div style="vertical-align: top"><span style="font-size: 8.5pt; color: black">关联的</span><span style="font-size: 8.5pt; color: black">CS</span><span style="font-size: 8.5pt; color: black">代码</span><span style="font-size: 8.5pt; color: black">: </span></div><div style="background: #f0f0f0; vertical-align: top"><span style="font-size: 8.5pt; color: #0600ff">using</span><span style="font-size: 8.5pt; color: teal">System</span><span style="font-size: 8.5pt; color: green">;</span><span style="font-size: 8.5pt; color: #000066"><br /></span><span style="font-size: 8.5pt; color: #0600ff">using</span><span style="font-size: 8.5pt; color: teal">System.Collections.Generic</span><span style="font-size: 8.5pt; color: green">;</span><span style="font-size: 8.5pt; color: #000066"><br /></span><span style="font-size: 8.5pt; color: #0600ff">using</span><span style="font-size: 8.5pt; color: teal">System.Web</span><span style="font-size: 8.5pt; color: green">;</span><span style="font-size: 8.5pt; color: #000066"><br /></span><span style="font-size: 8.5pt; color: #0600ff">using</span><span style="font-size: 8.5pt; color: teal">System.Web.UI</span><span style="font-size: 8.5pt; color: green">;</span><span style="font-size: 8.5pt; color: #000066"><br /></span><span style="font-size: 8.5pt; color: #0600ff">using</span><span style="font-size: 8.5pt; color: teal">System.Web.UI.WebControls</span><span style="font-size: 8.5pt; color: green">;</span><span style="font-size: 8.5pt; color: #000066"><br /><br /></span><span style="font-size: 8.5pt; color: #0600ff">namespace</span><span style="font-size: 8.5pt; color: #000066"> SEOViewStateAdapterTest<br /></span><span style="font-size: 8.5pt; color: black">{</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><span style="font-size: 8.5pt; color: #0600ff">public</span><span style="font-size: 8.5pt; color: #0600ff">partial</span><span style="font-size: 8.5pt; color: red">class</span><span style="font-size: 8.5pt; color: #000066"> _Default </span><span style="font-size: 8.5pt; color: green">:</span><span style="font-size: 8.5pt; color: black">System.</span><span style="font-size: 8.5pt; color: blue">Web</span><span style="font-size: 8.5pt; color: black">.</span><span style="font-size: 8.5pt; color: blue">UI</span><span style="font-size: 8.5pt; color: #000066">.</span><span style="font-size: 8.5pt; color: blue">Page</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><span style="font-size: 8.5pt; color: black">{</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-size: 8.5pt; color: #0600ff">protected</span><span style="font-size: 8.5pt; color: #0600ff">void</span><span style="font-size: 8.5pt; color: #000066"> Page_Load</span><span style="font-size: 8.5pt; color: black">(</span><span style="font-size: 8.5pt; color: red">object</span><span style="font-size: 8.5pt; color: #000066"> sender, EventArgs e</span><span style="font-size: 8.5pt; color: black">)</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-size: 8.5pt; color: black">{</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-size: 8.5pt; color: #0600ff">if</span><span style="font-size: 8.5pt; color: black">(</span><span style="font-size: 8.5pt; color: green">!</span><span style="font-size: 8.5pt; color: #000066">Page.</span><span style="font-size: 8.5pt; color: blue">IsPostBack</span><span style="font-size: 8.5pt; color: black">)</span><span style="font-size: 8.5pt; color: black">{</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ViewState</span><span style="font-size: 8.5pt; color: black">[</span><span style="font-size: 8.5pt; color: #666666">&quot;previousMessage&quot;</span><span style="font-size: 8.5pt; color: black">]</span><span style="font-size: 8.5pt; color: green">=</span><span style="font-size: 8.5pt; color: #000066"> txtMessage.</span><span style="font-size: 8.5pt; color: blue">Text</span><span style="font-size: 8.5pt; color: green">;</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-size: 8.5pt; color: black">}</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-size: 8.5pt; color: black">}</span><span style="font-size: 8.5pt; color: #000066"><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-size: 8.5pt; color: #0600ff">protected</span><span style="font-size: 8.5pt; color: #0600ff">void</span><span style="font-size: 8.5pt; color: #000066"> bSaveMessage_Click</span><span style="font-size: 8.5pt; color: black">(</span><span style="font-size: 8.5pt; color: red">object</span><span style="font-size: 8.5pt; color: #000066"> sender, EventArgs e</span><span style="font-size: 8.5pt; color: black">)</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-size: 8.5pt; color: black">{</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lMessage.</span><span style="font-size: 8.5pt; color: blue">Text</span><span style="font-size: 8.5pt; color: green">=</span><span style="font-size: 8.5pt; color: red">String</span><span style="font-size: 8.5pt; color: #000066">.</span><span style="font-size: 8.5pt; color: blue">Format</span><span style="font-size: 8.5pt; color: black">(</span><span style="font-size: 8.5pt; color: #666666">&quot;The current message is '{0}'. The previous message was '{1}'&quot;</span><span style="font-size: 8.5pt; color: #000066">, txtMessage.</span><span style="font-size: 8.5pt; color: blue">Text</span><span style="font-size: 8.5pt; color: #000066">, </span><span style="font-size: 8.5pt; color: black">(</span><span style="font-size: 8.5pt; color: red">string</span><span style="font-size: 8.5pt; color: black">)</span><span style="font-size: 8.5pt; color: #000066">ViewState</span><span style="font-size: 8.5pt; color: black">[</span><span style="font-size: 8.5pt; color: #666666">&quot;previousMessage&quot;</span><span style="font-size: 8.5pt; color: black">])</span><span style="font-size: 8.5pt; color: green">;</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ViewState</span><span style="font-size: 8.5pt; color: black">[</span><span style="font-size: 8.5pt; color: #666666">&quot;previousMessage&quot;</span><span style="font-size: 8.5pt; color: black">]</span><span style="font-size: 8.5pt; color: green">=</span><span style="font-size: 8.5pt; color: #000066"> txtMessage.</span><span style="font-size: 8.5pt; color: blue">Text</span><span style="font-size: 8.5pt; color: green">;</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-size: 8.5pt; color: black">}</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><span style="font-size: 8.5pt; color: black">}</span><span style="font-size: 8.5pt; color: #000066"><br /></span><span style="font-size: 8.5pt; color: black">}</span><span style="font-size: 8.5pt; color: #000066"><br />&nbsp;</span></div><div style="vertical-align: top">&nbsp;</div><div style="vertical-align: top"><span style="font-size: 8.5pt; color: black">没有使用我们的适配器情况下，在几次</span><span style="font-size: 8.5pt; color: black"> postbacks </span><span style="font-size: 8.5pt; color: black">后，</span><span style="font-size: 8.5pt; color: black">我们看到网页的</span><span style="font-size: 8.5pt; color: black">HTML</span><span style="font-size: 8.5pt; color: black">代码是这样的</span></div><div style="background: #f0f0f0; vertical-align: top"><span style="font-size: 8.5pt; color: #00bbdd">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span><span style="font-size: 8.5pt; color: #000066"><br /><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;html</span></b><span style="font-size: 8.5pt; color: #000066">xmlns</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;http://www.w3.org/1999/xhtml&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;head&gt;&lt;title&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/title&gt;&lt;/head&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;body&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;form</span></b><span style="font-size: 8.5pt; color: #000066">name</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;form1&quot;</span><span style="font-size: 8.5pt; color: #000066">method</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;post&quot;</span><span style="font-size: 8.5pt; color: #000066">action</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;Default.aspx&quot;</span><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;form1&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;input</span></b><span style="font-size: 8.5pt; color: #000066">type</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;hidden&quot;</span><span style="font-size: 8.5pt; color: #000066">name</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;__VIEWSTATE&quot;</span><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;__VIEWSTATE&quot;</span><span style="font-size: 8.5pt; color: #000066">value</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;/wEPDwUJc01l[...]VwP+cfdSWI6Q==&quot;</span><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;input</span></b><span style="font-size: 8.5pt; color: #000066">type</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;hidden&quot;</span><span style="font-size: 8.5pt; color: #000066">name</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;__EVENTVALIDATION&quot;</span><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;__EVENTVALIDATION&quot;</span><span style="font-size: 8.5pt; color: #000066">value</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;/wEWAwKb4uenCgK/1s7/DwKf8MMPfiUvZtKPSXk//XdxkLooz8QDI0Y=&quot;</span><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; Enter a message: </span><b><span style="font-size: 8.5pt; color: black">&lt;br</span></b><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;input</span></b><span style="font-size: 8.5pt; color: #000066">name</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;txtMessage&quot;</span><span style="font-size: 8.5pt; color: #000066">type</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;text&quot;</span><span style="font-size: 8.5pt; color: #000066">value</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;Message 2&quot;</span><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;txtMessage&quot;</span><b><span style="font-size: 8.5pt; color: black">/&gt;&lt;br</span></b><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;input</span></b><span style="font-size: 8.5pt; color: #000066">type</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;submit&quot;</span><span style="font-size: 8.5pt; color: #000066">name</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;bSaveMessage&quot;</span><span style="font-size: 8.5pt; color: #000066">value</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;Save Message&quot;</span><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;bSaveMessage&quot;</span><b><span style="font-size: 8.5pt; color: black">/&gt;&lt;br</span></b><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;span</span></b><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;lMessage&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;</span></b><span style="font-size: 8.5pt; color: #000066">The current message is 'Message 2'. The previous message was 'Message 1'</span><b><span style="font-size: 8.5pt; color: black">&lt;/span&gt;&lt;br</span></b><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;p&gt;</span></b><span style="font-size: 8.5pt; color: #000066">Page generated at 08:13 04/12/2008</span><b><span style="font-size: 8.5pt; color: black">&lt;/p&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;/div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;/form&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/body&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/html&gt;</span></b></div><div style="vertical-align: top">&nbsp;</div><div style="vertical-align: top"><span style="font-size: 8.5pt; color: black">使用我们的适配器情况，在几次</span><span style="font-size: 8.5pt; color: black"> postbacks </span><span style="font-size: 8.5pt; color: black">后，</span><span style="font-size: 8.5pt; color: black">我们看到网页的</span><span style="font-size: 8.5pt; color: black">HTML</span><span style="font-size: 8.5pt; color: black">代码是这样的。</span><span style="font-size: 8.5pt; color: black">看，视图数据代码被移到底部啦。</span></div><div style="background: #f0f0f0; vertical-align: top"><span style="font-size: 8.5pt; color: #00bbdd">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span><span style="font-size: 8.5pt; color: #000066"><br /><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;html</span></b><span style="font-size: 8.5pt; color: #000066">xmlns</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;http://www.w3.org/1999/xhtml&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;head&gt;&lt;title&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/title&gt;&lt;/head&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;body&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;form</span></b><span style="font-size: 8.5pt; color: #000066">name</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;form1&quot;</span><span style="font-size: 8.5pt; color: #000066">method</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;post&quot;</span><span style="font-size: 8.5pt; color: #000066">action</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;Default.aspx&quot;</span><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;form1&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;input</span></b><span style="font-size: 8.5pt; color: #000066">type</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;hidden&quot;</span><span style="font-size: 8.5pt; color: #000066">name</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;__VIEWSTATE&quot;</span><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;__VIEWSTATE&quot;</span><span style="font-size: 8.5pt; color: #000066">value</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;&quot;</span><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;input</span></b><span style="font-size: 8.5pt; color: #000066">type</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;hidden&quot;</span><span style="font-size: 8.5pt; color: #000066">name</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;__EVENTVALIDATION&quot;</span><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;__EVENTVALIDATION&quot;</span><span style="font-size: 8.5pt; color: #000066">value</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;/wEWAwL+raDpAgK/1s7/DwKf8MMPyF7nqN1AbwNwFBq8OAjEAQorsyo=&quot;</span><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; Enter a message: </span><b><span style="font-size: 8.5pt; color: black">&lt;br</span></b><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;input</span></b><span style="font-size: 8.5pt; color: #000066">name</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;txtMessage&quot;</span><span style="font-size: 8.5pt; color: #000066">type</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;text&quot;</span><span style="font-size: 8.5pt; color: #000066">value</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;Message 2&quot;</span><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;txtMessage&quot;</span><b><span style="font-size: 8.5pt; color: black">/&gt;&lt;br</span></b><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;input</span></b><span style="font-size: 8.5pt; color: #000066">type</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;submit&quot;</span><span style="font-size: 8.5pt; color: #000066">name</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;bSaveMessage&quot;</span><span style="font-size: 8.5pt; color: #000066">value</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;Save Message&quot;</span><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;bSaveMessage&quot;</span><b><span style="font-size: 8.5pt; color: black">/&gt;&lt;br</span></b><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;span</span></b><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;lMessage&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;</span></b><span style="font-size: 8.5pt; color: #000066">The current message is 'Message 2'. The previous message was 'Message 1'</span><b><span style="font-size: 8.5pt; color: black">&lt;/span&gt;&lt;br</span></b><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;p&gt;</span></b><span style="font-size: 8.5pt; color: #000066">Page generated at 08:11 04/12/2008</span><b><span style="font-size: 8.5pt; color: black">&lt;/p&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;/div&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;input</span></b><span style="font-size: 8.5pt; color: #000066">type</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;hidden&quot;</span><span style="font-size: 8.5pt; color: #000066">name</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;__SEOVIEWSTATE&quot;</span><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;__SEOVIEWSTATE&quot;</span><span style="font-size: 8.5pt; color: #000066">value</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;/wEPc01lc3[...]CdNY6AtgigHvU=&quot;</span><b><span style="font-size: 8.5pt; color: black">/&gt;&lt;/form&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/body&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/html&gt;</span></b></div><div style="vertical-align: top">&nbsp;</div><div style="vertical-align: top"><span style="font-size: 8.5pt; color: black">为了使用的适配器，您必须添加一个引用，并添加一个名为</span><span style="font-size: 8.5pt; color: black">SEOViewStateAdapter.browser </span><span style="font-size: 8.5pt; color: black">（文件的名称并不重要。扩展名需要是相同的。或者也可以合并的内容另一个文件如果您已经有一个）到</span><span style="font-size: 8.5pt; color: black">App_Browsers</span><span style="font-size: 8.5pt; color: black">文件夹中。该文件应为：</span></div><div style="background: #f0f0f0; vertical-align: top"><b><span style="font-size: 8.5pt; color: black">&lt;browsers&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><i><span style="font-size: 8.5pt; color: gray">&lt;!-- use the adapters for all browsers --&gt;</span></i><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;browser</span></b><span style="font-size: 8.5pt; color: #000066">refID</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;Default&quot;</span><b><span style="font-size: 8.5pt; color: black">&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;controlAdapters&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><i><span style="font-size: 8.5pt; color: gray">&lt;!-- ths adapter is used to save the view and control state at the bottom of the form so the page is more friendly to search engines --&gt;</span></i><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;adapter</span></b><span style="font-size: 8.5pt; color: #000066">controlType</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;System.Web.UI.Page&quot;</span><span style="font-size: 8.5pt; color: #000066">adapterType</span><span style="font-size: 8.5pt; color: #009900">=</span><span style="font-size: 8.5pt; color: red">&quot;Manu.Web.Adapters.SEOFriendlyViewStatePageAdapter, SEOViewStateAdapter&quot;</span><b><span style="font-size: 8.5pt; color: black">/&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; &nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;/controlAdapters&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp; &nbsp; </span><b><span style="font-size: 8.5pt; color: black">&lt;/browser&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br /></span><b><span style="font-size: 8.5pt; color: black">&lt;/browsers&gt;</span></b><span style="font-size: 8.5pt; color: #000066"><br />&nbsp;</span></div><div style="vertical-align: top">&nbsp;<span style="font-size: 8.5pt; color: black">当你还不是很明白讲的是文章内容的时候，你可以下载下面的代码来看。</span></div><p><a target="_blank" href="http://www.blog-design.cn/upload/2009/4/SEOViewState.zip"><span style="color: #ff0000">SEOViewState.zip</span></a></p>]]></description><category>SEO与程序员系列</category><comments>http://www.blog-design.cn/post/aspdotnet-seo-viewstate2.html#comment</comments><wfw:comment>http://www.blog-design.cn/</wfw:comment><wfw:commentRss>http://www.blog-design.cn/feed.asp?cmt=152</wfw:commentRss><trackback:ping>http://www.blog-design.cn/cmd.asp?act=tb&amp;id=152&amp;key=f453c3e8</trackback:ping></item><item><title>Asp.Net程序员与SEO  - Viewstate优化( 一 )</title><author>abcily@126.com (Arain)</author><link>http://www.blog-design.cn/post/aspdotnet-seo-viewstate.html</link><pubDate>Thu, 02 Apr 2009 09:43:19 +0800</pubDate><guid>http://www.blog-design.cn/post/aspdotnet-seo-viewstate.html</guid><description><![CDATA[<p><span style="font-size: 9pt">什么是</span><span style="border-right: windowtext 1pt; padding-right: 0cm; border-top: windowtext 1pt; padding-left: 0cm; font-size: 9pt; padding-bottom: 0cm; border-left: windowtext 1pt; color: #4183d3; padding-top: 0cm; border-bottom: windowtext 1pt">Viewstate</span><span style="font-size: 9pt">？例如：</span><span style="font-size: 9pt">&lt;input type=&quot;hidden&quot; name=&quot;__VIEWSTATE&quot; id=&quot;__VIEWSTATE&quot; value=&quot;DwxNTgzOTU2ODA7dDw7bDxpPDE+Oz47bDx0PDtsPGk8MT47PjtsPHQ8QDA8cDxwPGw8UGFnZUNvdW50O18hSXRlbUNvdW50O18hRGF0YVNvdXJjZUl0ZW1Db3VudDtEYXRhS2V5czs+O2w8aTwxPjtpPDg+O2k8OD47bDw+Oz4+Oz47Ozs7Ozs7OztAMDxAMDxwPGw8SGVhZGVyVGV4dDtEYXRhRmllbGQ7U29ydEV4cHJlc3Npb247UmVhZE9ubHk7PjtsPHB1Yl9pZDtwdWJfaWQ7cHViX2lkO288Zj47Pj47Ozs7PjtAMDxwPGw8SGVhZGVyVGV4dDtEYXRhRmllbGQ7U29ydEV4cHJlc3Npb247UmVhZE9ubHk7PjtsPHB1Yl9uYW1lO3B1Yl9uYW1lO3B1Yl9uYW1 lO288Zj47Pj47Ozs7PjtAMDxw&quot; /&gt;</span></p><div><span style="font-size: 9pt">当我看到这一大片内容的时候就觉得这是一个</span><span style="font-size: 9pt"><a target="_blank" href="http://www.blog-design.cn/post/SeoPogrammer.html">asp.net</a></span><span style="font-size: 9pt"><a target="_blank" href="http://www.blog-design.cn/post/SeoPogrammer.html">SEO</a>过程中的难题，一直没有找到方法，这些天查了下英文站找到了这个方法。下面是我看了</span><span style="font-size: 9pt">Search Engine Optimization - Moving View State to the bottom of the page</span><span style="font-size: 9pt">（</span><span style="font-size: 9pt"><a href="http://www.manuelabadia.com/blog/PermaLink,guid,7924eaf8-b406-43af-9444-b816f6dfa246.aspx">http://www.manuelabadia.com/blog/PermaLink,guid,7924eaf8-b406-43af-9444-b816f6dfa246.aspx</a></span><span style="font-size: 9pt">）这篇文章后，觉得该方法可行，就翻译了一下，我英文水平有限，只把我看懂的大概意思和自己的理解写下来，希望对大家有帮助。</span></div><div>&nbsp;</div><div><span style="font-size: 9pt">当我们去对一个</span><span style="font-size: 9pt">ASP.Net</span><span style="font-size: 9pt">页面做</span><span style="font-size: 9pt">SEO</span><span style="font-size: 9pt">的时候，会发现一个很大的问题那就是隐藏的视图状态。很多搜索引擎都明确页面抓取的界限，那就是只会抓取到网页前几千个字节的文本内容，所以当你页面的前</span><span style="font-size: 9pt">2KB</span><span style="font-size: 9pt">是</span><span style="font-size: 9pt">ViewState</span><span style="font-size: 9pt">垃圾的时候，你的页面很可能会遭到处罚。那么我这篇文章的目的就是把视图状态数据移动到尽可能少。</span></div><div>&nbsp;</div><div><span style="font-size: 9pt">我已经发现一些途径来解决这个问题，在响应输出的时候重写最终的</span><span style="font-size: 9pt">HTML</span><span style="font-size: 9pt">编码。当这个方法执行后我发先它占有很大的</span><span style="font-size: 9pt">CPU</span><span style="font-size: 9pt">使用。所以，我需要一种方式既能实现功能又不浪费的</span><span style="font-size: 9pt">CPU</span><span style="font-size: 9pt">的方法。我发现反射的方式做到这一点。我的方法使用的</span><span style="font-size: 9pt">ASP.NET</span><span style="font-size: 9pt">控制适配器架构。</span></div><div>&nbsp;</div><div><span style="font-size: 9pt">控制适配器是一个可以用来控制所产生的</span><span style="font-size: 9pt">HTML</span><span style="font-size: 9pt">控制它适应的类。由于页面类，是一种负责任的渲染视图状态隐藏字段（</span><span style="font-size: 9pt"> Page.BeginFormRender</span><span style="font-size: 9pt">调用</span><span style="font-size: 9pt">Page.RenderViewStateFields </span><span style="font-size: 9pt">）</span><span style="font-size: 9pt">，适配器的网页是必要的。然而，视图状态隐藏字段在</span><span style="font-size: 9pt">ASP.NET</span><span style="font-size: 9pt">基础架构中起着关键作用和难以修改相关的</span><span style="font-size: 9pt">HTML </span><span style="font-size: 9pt">。</span></div><div>&nbsp;</div><div><span style="font-size: 9pt">一个</span><span style="font-size: 9pt">PageAdapter</span><span style="font-size: 9pt">有一个方法叫做</span><span style="font-size: 9pt">GetStatePersister</span><span style="font-size: 9pt">（）返回的对象继承于</span><span style="font-size: 9pt">PageStatePersister </span><span style="font-size: 9pt">。当加载和保存视图状态的时候调用</span><span style="font-size: 9pt">PageStatePersister</span><span style="font-size: 9pt">。这里有</span><span style="font-size: 9pt">2</span><span style="font-size: 9pt">个类是从</span><span style="font-size: 9pt">PageStatePersister </span><span style="font-size: 9pt">：</span><span style="font-size: 9pt"> HiddenFieldPageStatePersister</span><span style="font-size: 9pt">和</span><span style="font-size: 9pt">SessionPageStatePersister</span><span style="font-size: 9pt">继承来的</span><span style="font-size: 9pt">。第一种是默认情况下，存储视图状态中的隐藏字段名为</span><span style="font-size: 9pt">__VIEWSTATE </span><span style="font-size: 9pt">。第二个存储视图状态在</span><span style="font-size: 9pt">session</span><span style="font-size: 9pt">中。因此，我们可以很容易地创建一个自定义</span><span style="font-size: 9pt">PageStatePersister</span><span style="font-size: 9pt">来控制视图状态加载和保存过程。最大的问题是如何在</span><span style="font-size: 9pt">form</span><span style="font-size: 9pt">标记关闭之前建立隐藏的视图状态，同时以完全透明的解决办法。经过一些尝试我想出了一个解决方案，我很高兴的。</span></div><div>&nbsp;</div><div><span style="font-size: 9pt">我意识到，这是不可能完全从页面顶部删除视图状态隐藏字段，因为他在</span><span style="font-size: 9pt">ASP.NET</span><span style="font-size: 9pt">的架构这方面发挥着关键作用。但是，同任何自定义页面状态持续的</span><span style="font-size: 9pt">ASP.NET</span><span style="font-size: 9pt">基础架构提供至少一个空视图状态的隐藏字段只有</span><span style="font-size: 9pt">70</span><span style="font-size: 9pt">字节：</span></div><div>&nbsp;</div><div style="background: #f0f0f0; vertical-align: top"><span style="font-size: 8.5pt; color: #009900">&lt;<a href="http://www.manuelabadia.com/blog/ct.ashx?id=7924eaf8-b406-43af-9444-b816f6dfa246&amp;url=http%3a%2f%2fdecember.com%2fhtml%2f4%2felement%2finput.html"><b><span style="color: black">input</span></b></a> </span><span style="font-size: 8.5pt; color: #000066">type</span><span style="font-size: 8.5pt; color: #66cc66">=</span><span style="font-size: 8.5pt; color: red">&quot;hidden&quot;</span><span style="font-size: 8.5pt; color: #000066">name</span><span style="font-size: 8.5pt; color: #66cc66">=</span><span style="font-size: 8.5pt; color: red">&quot;__VIEWSTATE&quot;</span><span style="font-size: 8.5pt; color: #000066">id</span><span style="font-size: 8.5pt; color: #66cc66">=</span><span style="font-size: 8.5pt; color: red">&quot;__VIEWSTATE&quot;</span><span style="font-size: 8.5pt; color: #000066">value</span><span style="font-size: 8.5pt; color: #66cc66">=</span><span style="font-size: 8.5pt; color: red">&quot;&quot;</span><span style="font-size: 8.5pt; color: #66cc66">/</span><span style="font-size: 8.5pt; color: #009900">&gt;</span></div>]]></description><category>SEO与程序员系列</category><comments>http://www.blog-design.cn/post/aspdotnet-seo-viewstate.html#comment</comments><wfw:comment>http://www.blog-design.cn/</wfw:comment><wfw:commentRss>http://www.blog-design.cn/feed.asp?cmt=149</wfw:commentRss><trackback:ping>http://www.blog-design.cn/cmd.asp?act=tb&amp;id=149&amp;key=3efa82f5</trackback:ping></item><item><title>Asp.Net程序员与SEO - .Net的URL静态化</title><author>abcily@126.com (Arain)</author><link>http://www.blog-design.cn/post/aspdotnet-seo-url.html</link><pubDate>Thu, 26 Mar 2009 08:57:46 +0800</pubDate><guid>http://www.blog-design.cn/post/aspdotnet-seo-url.html</guid><description><![CDATA[<p><span style="font-size: 9pt; font-family: Tahoma">Url</span><span style="font-size: 9pt; font-family: 宋体">的规范在</span><span style="font-size: 9pt; font-family: Tahoma">SEO</span><span style="font-size: 9pt; font-family: 宋体">中也是一个非常重要的部分。讲到这里先讲下搜索引擎最新的动态。</span>&nbsp;</p><div><b><span style="font-size: 9pt; font-family: Tahoma">Url</span></b><b><span style="font-size: 9pt; font-family: 宋体">的规范</span></b></div><div><span style="font-size: 9pt; font-family: 宋体">动态</span><span style="font-size: 9pt; font-family: Tahoma">URL</span><span style="font-size: 9pt; font-family: 宋体">往往是搜索引擎比较头疼的事情。椐估计，网上有</span><span style="font-size: 9pt; font-family: Tahoma">10%-30%</span><span style="font-size: 9pt; font-family: 宋体">的</span><span style="font-size: 9pt; font-family: Tahoma">URL</span><span style="font-size: 9pt; font-family: 宋体">是内容相同但</span><span style="font-size: 9pt; font-family: Tahoma">URL</span><span style="font-size: 9pt; font-family: 宋体">不一样的不规范网址，而这样导致的最严重问题就是搜索引擎会把这些内容相同的页面可能定为复制页面，也分散了权重，不利于排名，而对于搜索引擎无疑是一种资源的浪费。这是站长跟搜索引擎都不愿意看到的。而最近</span><span style="font-size: 9pt; font-family: Tahoma">google</span><span style="font-size: 9pt; font-family: 宋体">，</span><span style="font-size: 9pt; font-family: Tahoma">microsoft</span><span style="font-size: 9pt; font-family: 宋体">和</span><span style="font-size: 9pt; font-family: Tahoma">yahoo</span><span style="font-size: 9pt; font-family: 宋体">共同提出了一个</span><span style="font-size: 9pt; font-family: Tahoma">URL</span><span style="font-size: 9pt; font-family: 宋体">规范来避免这一现象的产生。</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: 宋体">前几天</span><span style="font-size: 9pt; font-family: Tahoma">Google</span><span style="font-size: 9pt; font-family: 宋体">，雅虎，微软共同发布了一个新的标签</span><span style="font-size: 9pt; font-family: Tahoma">canonical tag</span><span style="font-size: 9pt; font-family: 宋体">，用于解决网址规范化问题。</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: 宋体">简单说，就是在</span><span style="font-size: 9pt; font-family: Tahoma">HTML</span><span style="font-size: 9pt; font-family: 宋体">文件的头部加上这样一段代码：</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: Tahoma">&lt;link rel=&quot;canonical&quot; href=&quot;http://www.example.com/product.aspx&quot; /&gt;</span></div><div><span style="font-size: 9pt; font-family: 宋体">意义就是这个网页的规范化网址应该是：</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: Tahoma">http://www.example.com/product.aspx</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: 宋体">下面这些</span><span style="font-size: 9pt; font-family: Tahoma">URL</span><span style="font-size: 9pt; font-family: 宋体">都可以加上这段代码：</span></div><div><span style="font-size: 9pt; font-family: Tahoma">http://www.example.com/product.aspx?name=swedish-fish&amp;category=gummy-candy</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: Tahoma">http://www.example.com/product.aspx?name=swedish-fish&amp;trackingid=1234&amp;sessionid=5678</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: 宋体">这些</span><span style="font-size: 9pt; font-family: Tahoma">URL</span><span style="font-size: 9pt; font-family: 宋体">的真正规范化网址就都成为：</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: Tahoma">http://www.example.com/product.aspx</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: 宋体">简单说，这个标签相当是一个页面内的</span><span style="font-size: 9pt; font-family: Tahoma">301</span><span style="font-size: 9pt; font-family: 宋体">转向。区别在于用户并不被转向，还是停留在不变网址上，而搜索引擎会把它当作是</span><span style="font-size: 9pt; font-family: Tahoma">301</span><span style="font-size: 9pt; font-family: 宋体">转向处理，也就是说把页面链接的权重都集中到代码中指明的规范化网址上。</span></div><div>&nbsp;</div><div><b><span style="font-size: 9pt; font-family: Tahoma">Url</span></b><b><span style="font-size: 9pt; font-family: 宋体">静态化（</span></b><b><span style="font-size: 9pt; font-family: Tahoma">Asp.net Url</span></b><b><span style="font-size: 9pt; font-family: 宋体">重写）</span></b></div><div><span style="font-size: 9pt; font-family: Tahoma">Url</span><span style="font-size: 9pt; font-family: 宋体">静态化是相对于动态</span><span style="font-size: 9pt; font-family: Tahoma">Url</span><span style="font-size: 9pt; font-family: 宋体">而言的。</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: 宋体">动态</span><span style="font-size: 9pt; font-family: Tahoma">URL</span><span style="font-size: 9pt; font-family: 宋体">为在地址后有参数出现，例如：</span></div><div><span style="font-size: 9pt; font-family: Tahoma"><a href="http://www.example.com/product.aspx?name=swedish-fish&amp;trackingid=1234&amp;sessionid=567">http://www.example.com/product.aspx?name=swedish-fish&amp;trackingid=1234&amp;sessionid=567</a></span></div><div><span style="font-size: 9pt; font-family: 宋体">而静态化后</span></div><div><span style="font-size: 9pt; font-family: Tahoma"><a href="http://www.example.com/product/name/swedish-fish/trackingid/1234/sessionid/567/">http://www.example.com/product/name/swedish-fish/trackingid/1234/sessionid/567/</a></span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: 宋体">看到这个地址大家都应该感觉到静态化后的地址可能看上去更加简洁，而同样，搜索引擎对静态化后的</span><span style="font-size: 9pt; font-family: Tahoma">URL</span><span style="font-size: 9pt; font-family: 宋体">也更加喜欢。当然，静态化后的</span><span style="font-size: 9pt; font-family: Tahoma">URL</span><span style="font-size: 9pt; font-family: 宋体">必须更有意义才不浪费</span><span style="font-size: 9pt; font-family: Tahoma">URL</span><span style="font-size: 9pt; font-family: 宋体">静态化这一个步骤。</span></div><div><span style="font-size: 9pt; font-family: 宋体">例如：</span><span style="font-size: 9pt; font-family: Tahoma">http://www.example.com/product.aspx?id=1&amp; category=2</span></div><div><span style="font-size: 9pt; font-family: 宋体">静态化后：</span><span style="font-size: 9pt; font-family: Tahoma"><a href="http://www.example.com/product/1/2/">http://www.example.com/product/1/2/</a></span></div><div><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<a href="http://www.example.com/product/title1/category2/">http://www.example.com/product/category2/title1 /</a></span></div><div><span style="font-size: 9pt; font-family: 宋体">明显后一个静态化后地址比前一个要有意义，在</span><span style="font-size: 9pt; font-family: Tahoma">URL</span><span style="font-size: 9pt; font-family: 宋体">中出现了</span><span style="font-size: 9pt; font-family: Tahoma">title,category</span><span style="font-size: 9pt; font-family: 宋体">。</span><span style="font-size: 9pt; font-family: Tahoma">Url</span><span style="font-size: 9pt; font-family: 宋体">里如果出现些关键词那么对于搜索引擎来所更有意义。</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: Tahoma">Asp.Net</span><span style="font-size: 9pt; font-family: 宋体">静态化的方法很多，我就不摘录过来了，发布几个连接。记住，让你的</span><span style="font-size: 9pt; font-family: Tahoma">URL</span><span style="font-size: 9pt; font-family: 宋体">有意义。</span></div><div><span style="font-size: 9pt; font-family: Tahoma">Url</span><span style="font-size: 9pt; font-family: 宋体">静态化的方法连接：</span></div><div><span style="font-size: 9pt; font-family: Tahoma"><a href="http://msdn.microsoft.com/zh-cn/library/ms972974.aspx">http://msdn.microsoft.com/zh-cn/library/ms972974.aspx</a></span></div><div><span style="font-size: 9pt; font-family: Tahoma"><a href="http://blogs.iis.net/carlosag/archive/2008/09/02/iis-7-0-and-url-rewrite-make-your-web-site-seo.aspx">http://blogs.iis.net/carlosag/archive/2008/09/02/iis-7-0-and-url-rewrite-make-your-web-site-seo.aspx</a></span></div><div><span style="font-size: 9pt; font-family: Tahoma"><a href="http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx">http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx</a></span></div><div><span style="font-size: 9pt; font-family: Tahoma"><a href="http://www.codeproject.com/KB/aspnet/URL-Rewriting-in-ASPNET.aspx">http://www.codeproject.com/KB/aspnet/URL-Rewriting-in-ASPNET.aspx</a></span></div>]]></description><category>SEO与程序员系列</category><comments>http://www.blog-design.cn/post/aspdotnet-seo-url.html#comment</comments><wfw:comment>http://www.blog-design.cn/</wfw:comment><wfw:commentRss>http://www.blog-design.cn/feed.asp?cmt=146</wfw:commentRss><trackback:ping>http://www.blog-design.cn/cmd.asp?act=tb&amp;id=146&amp;key=23bed1a9</trackback:ping></item><item><title>Asp.Net程序员与SEO - .Net基于SEO友好数据分页</title><author>abcily@126.com (Arain)</author><link>http://www.blog-design.cn/post/aspdotnet-seo-page.html</link><pubDate>Sun, 22 Mar 2009 13:08:07 +0800</pubDate><guid>http://www.blog-design.cn/post/aspdotnet-seo-page.html</guid><description><![CDATA[<p><span style="font-size: 9pt; color: black; font-family: Tahoma">Asp.Net</span><span style="font-size: 9pt; color: black; font-family: 宋体">有很多用来显示数据的控件都是拖出来就可以用的，很简单，很方便，代码量也很少。象</span><span style="font-size: 9pt; color: black; font-family: Tahoma">GridViews</span><span style="font-size: 9pt; color: black; font-family: 宋体">和</span><span style="font-size: 9pt; color: black; font-family: Tahoma">DataGrids</span><span style="font-size: 9pt; color: black; font-family: 宋体">就属于这样的控件，但这两个控件分页机制采用的是</span><span style="font-size: 9pt; color: black; font-family: Tahoma">javascript</span><span style="font-size: 9pt; color: black; font-family: 宋体">来与本页交互实现的，分页后</span><span style="font-size: 9pt; color: black; font-family: Tahoma">url</span><span style="font-size: 9pt; color: black; font-family: 宋体">不会有新的改变。这样的话对</span><span style="font-size: 9pt; color: black; font-family: Tahoma">SEO</span><span style="font-size: 9pt; color: black; font-family: 宋体">不是很友好的，因为当搜索引擎爬虫（或成为蜘蛛）从你的网页上得到这个这个连接时，</span><span style="font-size: 9pt; color: black; font-family: Tahoma">&ldquo;</span><span style="font-size: 9pt; color: black; font-family: 宋体">点击进入</span><span style="font-size: 9pt; color: black; font-family: Tahoma">&rdquo;</span><span style="font-size: 9pt; color: black; font-family: 宋体">发现是属于同一页面，将不会将分页后的结果录入搜索引擎的编制结果。</span></p><div>&nbsp;<span style="font-size: 9pt; color: black; font-family: 宋体">从</span><span style="font-size: 9pt; color: black; font-family: Tahoma"><a target="_blank" href="http://www.blog-design.cn">SEO</a></span><span style="font-size: 9pt; color: black; font-family: 宋体">角度来讲，这种分页显示方法对搜索引擎爬虫是不友好的。这里我将用另外一中对搜索引擎更友好的分页方法来代替上的分页方法。我们可以使用</span><span style="font-size: 9pt; color: black; font-family: Tahoma">DataList</span><span style="font-size: 9pt; color: black; font-family: 宋体">或则</span><span style="font-size: 9pt; color: black; font-family: Tahoma">Repeater</span><span style="font-size: 9pt; color: black; font-family: 宋体">控件，通过</span><span style="font-size: 9pt; color: black; font-family: Tahoma">PagedDataSource</span><span style="font-size: 9pt; color: black; font-family: 宋体">来进行分页。</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; color: black; font-family: 宋体">我这里将用</span><span style="font-size: 9pt; color: black; font-family: Tahoma">Repeater</span><span style="font-size: 9pt; color: black; font-family: 宋体">控件来实现，为什么不用</span><span style="font-size: 9pt; color: black; font-family: Tahoma">DataList</span><span style="font-size: 9pt; color: black; font-family: 宋体">呢？个人觉得</span><span style="font-size: 9pt; color: black; font-family: Tahoma">DataList</span><span style="font-size: 9pt; color: black; font-family: 宋体">虽然功能强大于</span><span style="font-size: 9pt; color: black; font-family: Tahoma">Repeater</span><span style="font-size: 9pt; color: black; font-family: 宋体">，但是</span><span style="font-size: 9pt; color: black; font-family: Tahoma">DataList</span><span style="font-size: 9pt; color: black; font-family: 宋体">在生成</span><span style="font-size: 9pt; color: black; font-family: Tahoma">HTML</span><span style="font-size: 9pt; color: black; font-family: 宋体">代码的时候会有少量多余的代码出现例如：</span><span style="font-size: 9pt; color: black; font-family: Tahoma">span,table</span><span style="font-size: 9pt; color: black; font-family: 宋体">之类的。而</span><span style="font-size: 9pt; color: black; font-family: Tahoma">Repeater</span><span style="font-size: 9pt; color: black; font-family: 宋体">更能让我们控制代码的结构。分页的方法很多，网上搜索一下大把，下面我们来看下我的分页函数代码。</span></div><div align="left"><span style="font-size: 9pt; color: gray; font-family: Tahoma">///</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;summary&gt;</span></div><div align="left"><span style="font-size: 9pt; color: gray; font-family: Tahoma">///</span><span style="font-size: 9pt; color: green; font-family: 新宋体">分页函数</span></div><div align="left"><span style="font-size: 9pt; color: gray; font-family: Tahoma">///</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;/summary&gt;</span></div><div align="left"><span style="font-size: 9pt; color: gray; font-family: Tahoma">///</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;param name=&quot;pagesStr&quot;&gt;</span><span style="font-size: 9pt; color: gray; font-family: 新宋体">作为输出分页</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">HTML</span><span style="font-size: 9pt; color: gray; font-family: 新宋体">文本</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;/param&gt;</span></div><div align="left"><span style="font-size: 9pt; color: gray; font-family: Tahoma">///</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;param name=&quot;list&quot;&gt;</span><span style="font-size: 9pt; color: gray; font-family: 新宋体">需要分野数据源</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;/param&gt;</span></div><div align="left"><span style="font-size: 9pt; color: gray; font-family: Tahoma">///</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;param name=&quot;page&quot;&gt;</span><span style="font-size: 9pt; color: gray; font-family: 新宋体">默认页</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;/param&gt;</span></div><div align="left"><span style="font-size: 9pt; color: gray; font-family: Tahoma">///</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;param name=&quot;path&quot;&gt;URL</span><span style="font-size: 9pt; color: gray; font-family: 新宋体">地址</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;/param&gt;</span></div><div align="left"><span style="font-size: 9pt; color: gray; font-family: Tahoma">///</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;param name=&quot;pagesize&quot;&gt;</span><span style="font-size: 9pt; color: gray; font-family: 新宋体">每页的分布数据条数</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;/param&gt;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; color: gray; font-family: Tahoma">///</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;returns&gt;</span><span style="font-size: 9pt; color: gray; font-family: 新宋体">返回</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">PagedDataSource</span><span style="font-size: 9pt; color: gray; font-family: 新宋体">数据源</span><span style="font-size: 9pt; color: gray; font-family: Tahoma">&lt;/returns&gt;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; color: blue; font-family: Tahoma">public</span><span style="font-size: 9pt; font-family: Tahoma"> <span style="color: blue">static</span> <span style="color: #2b91af">PagedDataSource</span> pds(<span style="color: blue">out</span> <span style="color: blue">string</span> pagesStr, <span style="color: #2b91af">IList</span> list, <span style="color: blue">string</span> page, <span style="color: blue">string</span> path, <span style="color: blue">int</span> pagesize)</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">{</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: #2b91af">PagedDataSource</span> pds = <span style="color: blue">new</span> <span style="color: #2b91af">PagedDataSource</span>();</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; pds.DataSource = list;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; pds.AllowPaging = <span style="color: blue">true</span>;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; pds.PageSize = pagesize;</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; pagesStr = <span style="color: #a31515">&quot;&quot;</span>;</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">int</span> CurPage = 0;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">if</span> (page != <span style="color: blue">null</span> &amp;&amp; page.ToString() != <span style="color: #a31515">&quot;&quot;</span>)</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; {</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CurPage = <span style="color: blue">int</span>.Parse(page);</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; }</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">else</span></span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; {</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CurPage = 0;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; }</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; pds.CurrentPageIndex = CurPage;</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">int</span> startpage = CurPage;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">int</span> pageNum = 5;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">int</span> j = 0;</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">if</span> (pds.PageCount - CurPage &lt; pageNum)</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; {</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; startpage = (pds.PageCount - CurPage) + (CurPage - pageNum) &gt; 0 ? (pds.PageCount - CurPage) + (CurPage - pageNum) : 0;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; }</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">if</span> (!pds.IsFirstPage)</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; {</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pagesStr += <span style="color: #a31515">&quot;&lt;a href='&quot;</span> + path + <span style="color: #a31515">&quot;?Page=0' class='pagecode'&gt; &lt;&lt; &lt;/a&gt;&quot;</span>;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pagesStr += <span style="color: #a31515">&quot;&lt;a href='&quot;</span> + path + <span style="color: #a31515">&quot;?Page=&quot;</span> + <span style="color: #2b91af">Convert</span>.ToString(CurPage - 1) + <span style="color: #a31515">&quot;' class='pagecode'&gt; &lt; &lt;/a&gt;&quot;</span>;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; }</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">for</span> (<span style="color: blue">int</span> i = startpage; i &lt; pds.PageCount; i++)</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; {</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">if</span> (pds.PageCount == 1)</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">break</span>;</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pagesStr += <span style="color: #a31515">&quot;&lt;a href='&quot;</span> + path + <span style="color: #a31515">&quot;?Page=&quot;</span> + i.ToString() + <span style="color: #a31515">&quot;'&quot;</span>;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">if</span> (CurPage == i)</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pagesStr += <span style="color: #a31515">&quot; class='pagecodeActive'&quot;</span>;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">else</span></span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;{</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pagesStr += <span style="color: #a31515">&quot; class='pagecode'&quot;</span>;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pagesStr += <span style="color: #a31515">&quot;&gt;&quot;</span> + (i + 1).ToString() + <span style="color: #a31515">&quot;&lt;/a&gt;&quot;</span>;</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j++;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">if</span> (j == pageNum)</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">break</span>;</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; }</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">if</span> (!pds.IsLastPage)</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; {</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pagesStr += <span style="color: #a31515">&quot;&lt;a href='&quot;</span> + path + <span style="color: #a31515">&quot;?Page=&quot;</span> + <span style="color: #2b91af">Convert</span>.ToString(CurPage + 1) + <span style="color: #a31515">&quot;' class='pagecode'&gt; &gt; &lt;/a&gt;&quot;</span>;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pagesStr += <span style="color: #a31515">&quot;&lt;a href='&quot;</span> + path + <span style="color: #a31515">&quot;?Page=&quot;</span> + <span style="color: #2b91af">Convert</span>.ToString(pds.PageCount - 1) + <span style="color: #a31515">&quot;' class='pagecode'&gt; &gt;&gt; &lt;/a&gt;&quot;</span>;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; }</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; pagesStr += <span style="color: #a31515">&quot;</span></span><span style="font-size: 9pt; color: #a31515; font-family: 新宋体">总记录数</span><span style="font-size: 9pt; color: #a31515; font-family: Tahoma">&quot;</span><span style="font-size: 9pt; font-family: Tahoma"> + list.Count + <span style="color: #a31515">&quot;</span></span><span style="font-size: 9pt; color: #a31515; font-family: 新宋体">条</span><span style="font-size: 9pt; color: #a31515; font-family: Tahoma">&amp;nbsp;&quot;</span><span style="font-size: 9pt; font-family: Tahoma">;</span></div><div style="line-height: 11pt" align="left">&nbsp;</div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">return</span> pds;</span></div><div style="line-height: 11pt" align="left"><span style="font-size: 9pt; font-family: Tahoma">}</span></div><div style="line-height: 11pt"><span style="font-size: 9pt; color: blue; font-family: Tahoma">#endregion</span></div><div><span style="font-size: 9pt; font-family: 宋体">上面是函数，页面调用部分：</span></div><div align="left"><span style="font-size: 9pt; color: blue; font-family: Tahoma">string</span><span style="font-size: 9pt; font-family: Tahoma"> page;</span></div><div align="left"><span style="font-size: 9pt; color: blue; font-family: Tahoma">if</span><span style="font-size: 9pt; font-family: Tahoma"> (Request.QueryString[<span style="color: #a31515">&quot;page&quot;</span>] != <span style="color: blue">null</span> &amp;&amp; Request.QueryString[<span style="color: #a31515">&quot;page&quot;</span>].ToString() != <span style="color: #a31515">&quot;&quot;</span>)</span></div><div align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; page = Request.QueryString[<span style="color: #a31515">&quot;page&quot;</span>].ToString();</span></div><div align="left"><span style="font-size: 9pt; color: blue; font-family: Tahoma">else</span></div><div align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; page = <span style="color: #a31515">&quot;0&quot;</span>;</span></div><div align="left">&nbsp;</div><div align="left">&nbsp;</div><div align="left"><span style="font-size: 9pt; color: blue; font-family: Tahoma">string</span><span style="font-size: 9pt; font-family: Tahoma"> pagestr;</span></div><div align="left"><span style="font-size: 9pt; color: blue; font-family: Tahoma">this</span><span style="font-size: 9pt; font-family: Tahoma">.R_ModuleType.DataSource = <span style="color: #2b91af">Pagination</span>.pds(<span style="color: blue">out</span> pagestr, <span style="color: #2b91af">ResourceSrv</span>.GetAllResource(), page, Request.CurrentExecutionFilePath.ToString(), 20);</span></div><div align="left"><span style="font-size: 9pt; color: blue; font-family: Tahoma">this</span><span style="font-size: 9pt; font-family: Tahoma">.R_ModuleType.DataBind();</span></div><div align="left">&nbsp;</div><div><span style="font-size: 9pt; color: blue; font-family: Tahoma">this</span><span style="font-size: 9pt; font-family: Tahoma">.lb_total.Text = pagestr; //</span><span style="font-size: 9pt; font-family: 新宋体">可以放一个</span><span style="font-size: 9pt; font-family: Tahoma">div</span><span style="font-size: 9pt; font-family: 新宋体">来专门放</span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: Tahoma">.aspx</span><span style="font-size: 9pt; font-family: 宋体">部分</span></div><div align="left"><span style="font-size: 9pt; color: blue; font-family: Tahoma">&lt;</span><span style="font-size: 9pt; color: #a31515; font-family: Tahoma">asp</span><span style="font-size: 9pt; color: blue; font-family: Tahoma">:</span><span style="font-size: 9pt; color: #a31515; font-family: Tahoma">Repeater</span><span style="font-size: 9pt; font-family: Tahoma"> <span style="color: red">runat</span><span style="color: blue">=&quot;server&quot;</span> <span style="color: red">ID</span><span style="color: blue">=&quot;R_ModuleType&quot;&gt;</span></span></div><div style="text-indent: 18pt" align="left"><span style="font-size: 9pt; color: blue; font-family: Tahoma">&lt;</span><span style="font-size: 9pt; color: #a31515; font-family: Tahoma">HeaderTemplate</span><span style="font-size: 9pt; color: blue; font-family: Tahoma">&gt;</span></div><div style="text-indent: 18pt" align="left"><span style="font-size: 9pt; color: blue; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &hellip;&hellip; </span><span style="font-size: 9pt; color: blue; font-family: 新宋体">头部代码</span></div><div align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">&lt;/</span><span style="color: #a31515">HeaderTemplate</span><span style="color: blue">&gt;</span></span></div><div align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">&lt;</span><span style="color: #a31515">ItemTemplate</span><span style="color: blue">&gt;</span></span></div><div align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &hellip;&hellip; </span><span style="font-size: 9pt; font-family: 新宋体">内容代码</span></div><div align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">&lt;/</span><span style="color: #a31515">ItemTemplate</span><span style="color: blue">&gt;</span></span></div><div align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">&lt;</span><span style="color: #a31515">FooterTemplate</span><span style="color: blue">&gt;</span></span></div><div align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<span style="color: blue">&hellip;&hellip; </span></span><span style="font-size: 9pt; color: blue; font-family: 新宋体">底部代码部分</span></div><div align="left"><span style="font-size: 9pt; font-family: Tahoma">&nbsp;&nbsp;&nbsp; <span style="color: blue">&lt;/</span><span style="color: #a31515">FooterTemplate</span><span style="color: blue">&gt;</span></span></div><div><span style="font-size: 9pt; color: blue; font-family: Tahoma">&lt;/</span><span style="font-size: 9pt; color: #a31515; font-family: Tahoma">asp</span><span style="font-size: 9pt; color: blue; font-family: Tahoma">:</span><span style="font-size: 9pt; color: #a31515; font-family: Tahoma">Repeater</span><span style="font-size: 9pt; color: blue; font-family: Tahoma">&gt;</span></div><div><span style="font-size: 9pt; color: blue; font-family: Tahoma">&lt;</span><span style="font-size: 9pt; color: #a31515; font-family: Tahoma">asp</span><span style="font-size: 9pt; color: blue; font-family: Tahoma">:</span><span style="font-size: 9pt; color: #a31515; font-family: Tahoma">Literal</span><span style="font-size: 9pt; font-family: Tahoma"> <span style="color: red">ID</span><span style="color: blue">=&quot; lb_total &quot;</span> <span style="color: red">runat</span><span style="color: blue">=&quot;server&quot;&gt;&lt;/</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">Literal</span><span style="color: blue">&gt;</span></span></div><div>&nbsp;</div><div><span style="font-size: 9pt; font-family: Tahoma">CSS</span><span style="font-size: 9pt; font-family: 宋体">部分</span></div><div align="left"><span style="font-size: 9pt; color: green; font-family: Tahoma">/*</span><span style="font-size: 9pt; color: green; font-family: 新宋体">分页数字</span><span style="font-size: 9pt; color: green; font-family: Tahoma">*/</span></div><div align="left"><span style="font-size: 9pt; color: #a31515; font-family: Tahoma">.pagecode</span><span style="font-size: 9pt; font-family: Tahoma">,<span style="color: #a31515">.pagecodeActive</span>{<span style="color: red">margin</span>:<span style="color: blue">0</span> <span style="color: blue">2px</span>; <span style="color: red">padding</span>:<span style="color: blue">0</span> <span style="color: blue">5px</span>; <span style="color: red">border</span>:<span style="color: blue">1px</span> <span style="color: blue">solid</span> <span style="color: blue">#ccc</span>; <span style="color: red">float</span>:<span style="color: blue">left</span>; <span style="color: red">text-align</span>:<span style="color: blue">center</span>; }</span></div><div align="left"><span style="font-size: 9pt; color: #a31515; font-family: Tahoma">.pagecode</span><span style="font-size: 9pt; font-family: Tahoma">{ <span style="color: red">background-color</span>:<span style="color: blue">White</span>;}</span></div><div><span style="font-size: 9pt; color: #a31515; font-family: Tahoma">.pagecodeActive</span><span style="font-size: 9pt; font-family: Tahoma">{ <span style="color: red">background-color</span>:<span style="color: blue">#fffccc</span>;}</span></div><p><span style="font-size: 9pt; font-family: 新宋体">好了，代码写完了。希望能给初学者带来帮助。</span></p>]]></description><category>SEO与程序员系列</category><comments>http://www.blog-design.cn/post/aspdotnet-seo-page.html#comment</comments><wfw:comment>http://www.blog-design.cn/</wfw:comment><wfw:commentRss>http://www.blog-design.cn/feed.asp?cmt=144</wfw:commentRss><trackback:ping>http://www.blog-design.cn/cmd.asp?act=tb&amp;id=144&amp;key=19a641c4</trackback:ping></item><item><title>Asp.Net程序员与SEO - 关注Sitemap</title><author>abcily@126.com (Arain)</author><link>http://www.blog-design.cn/post/aspdotnet-seo-sitemap.html</link><pubDate>Thu, 19 Mar 2009 16:34:46 +0800</pubDate><guid>http://www.blog-design.cn/post/aspdotnet-seo-sitemap.html</guid><description><![CDATA[<p>Sitemap相信大家都有一定的了解，在<a target="_blank" href="http://www.blog-design.cn/">SEO</a>中也是相当重要的，在我看来sitemap应该分为两种一种是根据sitemap协议来制作，用来给搜索引擎抓取的协议性sitemap，而另外一种就是根据网站本身需求制作，用来给用户看的一个导航性sitemap。下面我就从这两种sitemap说下自己的理解。</p><p><strong>协议性sitemap<br /></strong>Sitemap 0.90 是依据<a href="http://creativecommons.org/licenses/by-sa/2.5/">创意公用授权-相同方式共享</a> (Attribution-ShareAlike Creative Commons License) 的条款提供的，并被广泛采用，受 Google、Yahoo! 和 Microsoft 在内的众多厂商的支持。<br />Sitemap 0.90是Google、Yahoo!、Microsoft、Ask等大多数搜索引擎所支持的一种标准。具体情况可以到<a href="http://sitemaps.org/zh_CN/index.php">http://sitemaps.org/zh_CN/index.php</a>查看。<br />下面我们就看下sitemap 0.90的编写规则</p><ul>    <li>以 &lt;urlset&gt; 开始标记作为开始，以 &lt;/urlset&gt; 结束标记作为结束。</li>    <li>在 &lt;urlset&gt; 标记中指定命名空间（协议标准）。</li>    <li>每个网址包含一个&lt;url&gt; 条目作为 XML 父标记。</li>    <li>在每个 &lt;url&gt; 父标记中包含一个 &lt;loc&gt; 子标记条目。</li></ul><p>下面是一个简单示例：<br />&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />&lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;&gt;<br />&lt;url&gt;<br />&lt;loc&gt;http://www.example.com/&lt;/loc&gt;<br />&lt;lastmod&gt;2005-01-01&lt;/lastmod&gt;<br />&lt;changefreq&gt;monthly&lt;/changefreq&gt;<br />&lt;priority&gt;0.8&lt;/priority&gt;<br />&lt;/url&gt;<br />&lt;url&gt;<br />&lt;loc&gt;http://www.example.com/contact/&lt;/loc&gt;<br />&lt;lastmod&gt;2005-01-01&lt;/lastmod&gt;<br />&lt;changefreq&gt;monthly&lt;/changefreq&gt;<br />&lt;priority&gt;0.8&lt;/priority&gt;<br />&lt;/url&gt;<br />&lt;/urlset&gt;</p><p>以下对可用 XML 标记进行说明。</p><table cellpadding="0" width="99%" border="0">    <tbody>        <tr>            <td width="17%"><br />            属性</td>            <td width="8%">            <p align="center">&nbsp;</p>            </td>            <td width="72%">            <p align="center">说明</p>            </td>        </tr>        <tr>            <td width="17%">            <p><a id="urlsetdef" name="urlsetdef"></a>&lt;urlset&gt;</p>            </td>            <td width="8%">            <p>必填</p>            </td>            <td width="72%">            <p>压缩此文件并提供当前协议标准作为参考。</p>            </td>        </tr>        <tr>            <td width="17%">            <p><a id="urldef" name="urldef"></a>&lt;url&gt;</p>            </td>            <td width="8%">            <p>必填</p>            </td>            <td width="72%">            <p>每个网址条目的父标记。剩余标记为此标记的子标记。</p>            </td>        </tr>        <tr>            <td width="17%">            <p><a id="locdef" name="locdef"></a>&lt;loc&gt;</p>            </td>            <td width="8%">            <p>必填</p>            </td>            <td width="72%">            <p>该页的网址。如果您的网络服务器需要网址的话，此网址应以协议开始（例如：http）并以斜杠结尾。该值必须少于 2,048 个字符。</p>            </td>        </tr>        <tr>            <td width="17%">            <p><a id="lastmoddef" name="lastmoddef"></a>&lt;lastmod&gt;</p>            </td>            <td width="8%">            <p>可选</p>            </td>            <td width="72%">            <p>该文件上次修改的日期。此日期应采用 <a href="http://www.w3.org/TR/NOTE-datetime">W3C Datetime</a> 格式。如果需要，此格式允许省略时间部分，并使用 YYYY-MM-DD。<br />            请注意，此标记不同于服务器可返回的 If-Modified-Since (304) 标头，搜索引擎可能会以不同的方式使用这两个来源的信息。</p>            </td>        </tr>        <tr>            <td width="17%">            <p><a id="changefreqdef" name="changefreqdef"></a>&lt;changefreq&gt;</p>            </td>            <td width="8%">            <p>可选</p>            </td>            <td width="72%">            <p>页面可能发生更改的频率。此值为搜索引擎提供一般性信息，可能与搜索引擎抓取页面的频率不完全相关。有效值为：</p>            <ul type="disc">                <li>always</li>                <li>hourly</li>                <li>daily</li>                <li>weekly</li>                <li>mothly</li>                <li>yearly</li>                <li>never</li>            </ul>            <p>&ldquo;always&rdquo;值应当用于描述随每次访问而改变的文档。而&ldquo;never&rdquo;值则应当用于描述存档的网址。<br />            请注意，抓取工具会将此标记的值视为提示而不是命令。尽管搜索引擎抓取工具在做决定时会考虑此信息，但对于标记为&ldquo;hourly&rdquo;页面的抓取频率可能低于每小时一次，而对于标记为&ldquo;yearly&rdquo;页面的抓取频率可能高于每年一次。抓取工具也可能会定期抓取标记为&ldquo;never&rdquo;的网页，以便能够处理对这些网页的未预期更改。</p>            </td>        </tr>        <tr>            <td width="17%">            <p><a id="prioritydef" name="prioritydef"></a>&lt;priority&gt;</p>            </td>            <td width="8%">            <p>可选</p>            </td>            <td width="72%">            <p>此网址的优先级是相对于您网站上其他网址的优先级而言的。有效值范围从 0.0 到 1.0。该值不会影响您的网页与其他网站上网页的比较结果，而只是告知搜索引擎您认为哪些网页对抓取工具来说最为重要。<br />            一个网页的默认优先级为 0.5。<br />            请注意，为网页指定的优先级并不会影响网址在搜索引擎结果页上的排名。搜索引擎在同一网站上选择不同网址时会使用此信息，因此，您可以使用此标记增加最重要的网页在搜索索引中显示的可能性。<br />            另请注意，为网站中的所有网址都指定高优先级并不会带来什么好处。因为优先级是相对的，只用于在您网站的网址之间进行选择。</p>            </td>        </tr>    </tbody></table><p>由于篇幅关系，我这里关于sitemap 0.90协议的编写规则就写这么多了具体关于 实体转义、sitemap索引（一个网站多个sitemap）、sitemap位置等可以到<a href="http://sitemaps.org/zh_CN/protocol.php#location">http://sitemaps.org/zh_CN/protocol.php#location</a>查看。</p><p><strong>导航性sitemap</strong><br />导航性sitemap，简单的说是属于一个站点导航器。把网站的各个节点按层级展现给用户，让用户能一目了然的看到这个网站的架构。在某种程度上在搜索引擎中起到了一个导航目录的内链建设作用。而展现的方式就因网站的不同而不同，这里就点到为止。</p><p>当然，asp.net有自己的一个sitemap，就是web.sitemap，他是属于一个代码性质的站点导航，在我的理解里他就好似一个导航性sitemap. 还有google标准的sitemap等。所有的sitemap的目的只有一个那就是清晰的暂时网站的架构，无论是按共同标准建设，还是按某一搜索引擎标准建设，无论是代码体现还是视图展现，无论是给用户还是给搜索引擎都起着一个牵引的作用，属于网站的一个目录，非常有必要性。写网站时千万不要忘记给网站建设两个sitemap。</p><p>下面共享一个我用asp.net写的按照sitemap 0.90协议生成sitemap.xml的简单示例：<a target="_blank" href="http://www.blog-design.cn/upload/2009/3/sitemap.rar">asp.net生成sitemap示例下载</a>。</p><p>ps:个人建议，协议性的sitemap在网站初期比较适用，一旦数据量增加，搜索引擎收录稳定，就取消sitemap功能吧，不然有可能搜索不完全。不过，如果有特殊需要，例如，需要用到Google webmaster中的查看链接等等。这些还是可以的。</p>]]></description><category>SEO与程序员系列</category><comments>http://www.blog-design.cn/post/aspdotnet-seo-sitemap.html#comment</comments><wfw:comment>http://www.blog-design.cn/</wfw:comment><wfw:commentRss>http://www.blog-design.cn/feed.asp?cmt=143</wfw:commentRss><trackback:ping>http://www.blog-design.cn/cmd.asp?act=tb&amp;id=143&amp;key=550c6a46</trackback:ping></item><item><title>Asp.Net程序员与SEO - 关注robots.txt</title><author>abcily@126.com (Arain)</author><link>http://www.blog-design.cn/post/aspdotseo-robot.html</link><pubDate>Thu, 19 Mar 2009 16:27:52 +0800</pubDate><guid>http://www.blog-design.cn/post/aspdotseo-robot.html</guid><description><![CDATA[<p>在国内，robots.txt文件，对于用户来说他是个可有可无的东西，也不会有人去看。但对于搜索引擎来讲它却是一个非常强大的东西，它可以说是你网站目录的&ldquo;看护神&rdquo;，可以用它来允许和禁止搜索引擎的搜录，下面我们就做一下详细讨论。</p><p>robots.txt基本介绍</p><p>robots.txt是一个纯文本文件，在这个文件中网站管理者可以声明该网站中不想被robots访问的部分，或者指定搜索引擎只收录指定的内容。</p><p>当一个搜索机器人（有的叫搜索蜘蛛）访问一个站点时，它会首先检查该站点根目录下是否存在robots.txt，如果存在，搜索机器人就会按照该文件中的内容来确定访问的范围；如果该文件不存在，那么搜索机器人就沿着链接抓取。</p><p>另外，robots.txt必须放置在一个站点的根目录下，而且文件名必须全部小写。比如：http://www.cnblogs.com/robots.txt</p><p>robots.txt写作语法</p><p>首先，我们来看一个robots.txt范例：http://www.blog-design.cn/robots.txt<br />访问以上具体地址，我们可以看到robots.txt的具体内容如下：</p><p># Robots.txt file from http://www.blog-design.cn<br /># All robots will spider the domain</p><p>User-agent: *<br />Disallow:</p><p>以上文本表达的意思是允许所有的搜索机器人访问www.blog-design.cn站点下的所有文件。</p><p>具体语法分析：其中#后面文字为说明信息；User-agent:后面为搜索机器人的名称，后面如果是*，则泛指所有的搜索机器人；Disallow:后面为不允许访问的文件目录。</p><p>下面，我将列举一些robots.txt的具体用法：<br />允许所有的robot访问</p><p>User-agent: *<br />Disallow:</p><p>或者也可以建一个空文件 &quot;/robots.txt&quot; file</p><p>禁止所有搜索引擎访问网站的任何部分<br />User-agent: *<br />Disallow: /</p><p>禁止所有搜索引擎访问网站的几个部分（下例中的admin、user、files目录）<br />User-agent: *<br />Disallow: /admin/<br />Disallow: /user/<br />Disallow: /files/</p><p>禁止某个搜索引擎的访问（下例中的Baiduspider）<br />User-agent: Baiduspider<br />Disallow: /</p><p>常见的搜索引擎机器人名称<br />搜索机器人名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; URL<br />Baiduspider&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://www.baidu.com<br />Scooter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://www.altavista.com<br />ia_archiver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://www.alexa.com<br />Googlebot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://www.google.com<br />Inktomi Slurp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;http://www.yahoo.com<br />FAST-WebCrawler&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://www.alltheweb.com<br />Slurp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://www.inktomi.com<br />MSNbot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://search.msn.com</p><p>只允许某个搜索引擎的访问（下例中的Baiduspider）<br />User-agent: Baiduspider<br />Disallow:</p><p>User-agent: *<br />Disallow: /</p><p>另外，robots也可以在meta标签内进行设置，下面来一些介绍：<br />Robots META标签则主要是针对一个个具体的页面。和其他的META标签（如使用的语言、页面的描述、关键词等）一样，Robots META标签也是放在页面的&lt;head&gt;&lt;/head&gt;中，专门用来告诉搜索引擎ROBOTS如何抓取该页的内容。</p><p>Robots META标签的写法：<br />Robots META标签中没有大小写之分，name=&rdquo;Robots&rdquo;表示所有的搜索引擎，可以针对某个具体搜索引擎写为name=&rdquo;BaiduSpider&rdquo;。 content部分有四个指令选项：index、noindex、follow、nofollow，指令间以&ldquo;,&rdquo;分隔。</p><p>INDEX 指令告诉搜索机器人抓取该页面；<br />FOLLOW 指令表示搜索机器人可以沿着该页面上的链接继续抓取下去；<br />Robots Meta标签的缺省值是INDEX和FOLLOW，只有inktomi除外，对于它，缺省值是INDEX,NOFOLLOW。</p><p>这样，一共有四种组合：<br />&lt;META NAME=&quot;ROBOTS&quot; CONTENT=&quot;INDEX,FOLLOW&quot;&gt;<br />&lt;META NAME=&quot;ROBOTS&quot; CONTENT=&quot;NOINDEX,FOLLOW&quot;&gt;<br />&lt;META NAME=&quot;ROBOTS&quot; CONTENT=&quot;INDEX,NOFOLLOW&quot;&gt;<br />&lt;META NAME=&quot;ROBOTS&quot; CONTENT=&quot;NOINDEX,NOFOLLOW&quot;&gt;</p><p>其中<br />&lt;META NAME=&quot;ROBOTS&quot; CONTENT=&quot;INDEX,FOLLOW&quot;&gt;可以写成&lt;META NAME=&quot;ROBOTS&quot; CONTENT=&quot;ALL&quot;&gt;；<br />&lt;META NAME=&quot;ROBOTS&quot; CONTENT=&quot;NOINDEX,NOFOLLOW&quot;&gt;可以写成&lt;META NAME=&quot;ROBOTS&quot; CONTENT=&quot;NONE&quot;&gt;</p><p>目前看来，绝大多数的搜索引擎机器人都遵守robots.txt的规则，而对于Robots META标签，目前支持的并不多，但是正在逐渐增加，如著名搜索引擎GOOGLE就完全支持，而且GOOGLE还增加了一个指令&ldquo;archive&rdquo;，可以限制GOOGLE是否保留网页快照。例如：<br />&lt;META NAME=&quot;googlebot&quot; CONTENT=&quot;index,follow,noarchive&quot;&gt;<br />表示抓取该站点中页面并沿着页面中链接抓取，但是不在GOOLGE上保留该页面的网页快照。</p><p>上面做了些简单的介绍，我们做网站时一定要加一个robots.txt在跟目录下，搜索引擎找到你网站后第一步就会找你的robots.txt看他是否有权限抓取。</p><p>PS：小经验分享<br />1. 当你的程序防护措施不是很好的时候在robots.txt里面禁止搜索引擎搜录你的后台地址。<br />2. 当你的网站是公司内部使用的web系统的时候不妨禁止所有搜索引擎访问来避免不需要的麻烦。<br />3．当你的网站刚刚架设起来，而可能会对网站架构有改动的时候，不妨暂时禁止所有搜索引擎搜录，让搜索引擎憋上一段时间。当你网站稳定后再把禁止取消，这时候你的网站会有一个更好的搜录效果。</p>]]></description><category>SEO与程序员系列</category><comments>http://www.blog-design.cn/post/aspdotseo-robot.html#comment</comments><wfw:comment>http://www.blog-design.cn/</wfw:comment><wfw:commentRss>http://www.blog-design.cn/feed.asp?cmt=142</wfw:commentRss><trackback:ping>http://www.blog-design.cn/cmd.asp?act=tb&amp;id=142&amp;key=00158bf3</trackback:ping></item><item><title>Asp.Net程序员与SEO – 庞大的反向链接网络(二)</title><author>abcily@126.com (Arain)</author><link>http://www.blog-design.cn/post/aspdotnet-seo-links-2.html</link><pubDate>Tue, 17 Mar 2009 23:10:19 +0800</pubDate><guid>http://www.blog-design.cn/post/aspdotnet-seo-links-2.html</guid><description><![CDATA[<p>上篇文章提到反向链接的概念，现在我就从增加反向链接的方法来谈谈作为一个程序员应该怎么为增加反向链接做一些SEO工作。</p><p><strong>1. 内部链接优化</strong><br />对于很多大型网站，由于网站自身都拥有几百万个网页，所以对网站内部链接进行重新优化构架之后，就可以让自身的网页给自己的众多关键词网页制造反向链接。这些反向链接虽然质量不高，但是由于数量庞大，所以也可以很快起到很好的效果。 <br />程序员的SEO工作：如下图链接关系图。我们处在B文章页面，那么就可以在该页导出一些链接到网站的其他页。 <br /><img title="" alt="" src="http://www.blog-design.cn/upload/2009/3/links-2.gif" onload="ResizeImage(this,520)" /><br />如图 所示，为你的网站程序提供网站导航和面包屑导航功能。这样可以让你的页面层级更加明显。形成一个强大的树状链接网。 <br />如图 ，为你的网站程序文章页提供&ldquo;上一篇，下一篇&rdquo;功能。这样可以让你所有此系列内容页形成一个强大的扁线性链接网。 <br />如 所示，为你的网站程序提供相关页面功能。可以是关键词相关，也可以是父级相关。 <br />为你的网站程序提供一个生成站点地图的功能，或则制作一张站点地图。站点地图我将在下篇文章谈到。 <br />最后说两点，每个网页最多离首页四次点击就能到达，网站的导航系统最好使用文字链接。</p><p><strong>2. 友情链接交换 </strong><br />友情链接交换是作为引入外部链接的一个重要的方式。找一些与自己网站主题相类似的网站做友情连接是一种很好很高效的外链引入方案。 <br />所以在这里我强烈建议程序员在网站程序制作过程中为自己的网站系统提供一个友情链接的申请和管理的模块。</p><p><strong>3.其他增加反向链接的手段 </strong><br />包括软文链接，购买链接，博客等等。 <br />这里建议程序员为自己的网站建立一个RSS源，为了方便用户通过豆瓣，鲜果，google等进行订阅，而也方便搜索引擎抓取。跟反向链接的关系是什么呢？订阅的人越多也可以为你的网站增加反向连接。同时如果你的网站更新足够快，内容足够健康，网站权威足够大你可以利用他来作为GOOGLE新闻咨询，博客等的文章源。</p><p>最后补充几点： <br />1.网站首页、频道页、分类页、栏目页等都是列表页，它的内容是由链接的锚文本构成的 <br />2.URL的写法设计最好与网站逻辑结构吻合，按照树型结构向下设计，目录层次深不影响SEO的效果(根据网站自身情况而言)，一切均以模拟用户逻辑思维来决定，并不存在用户需要越少次点击到达内容页越好的情况，或者可以从另一个角度去理解，记住：如果网站提供搜索功能，那每个页面我都可以用2次点击达到，根本不需要网站导航的存在，就好比你在Google上搜索关键词一样，但我们却无法完全模拟用户的搜索行为。</p><p>反向链接的建立策略是一个长期的过程，所以对于SEOer来说需要很好的耐性。而对于设计网站程序的SEO程序员来说，最主要的是把网站的整个架构很好的优化，让网站首页、频道页、分类页、栏目页、列表页、内容页就形成一个庞大的内部链接架构，为后期SEO省去大量时间去做关键词策略和外链建设工作。</p>]]></description><category>SEO与程序员系列</category><comments>http://www.blog-design.cn/post/aspdotnet-seo-links-2.html#comment</comments><wfw:comment>http://www.blog-design.cn/</wfw:comment><wfw:commentRss>http://www.blog-design.cn/feed.asp?cmt=141</wfw:commentRss><trackback:ping>http://www.blog-design.cn/cmd.asp?act=tb&amp;id=141&amp;key=138e54a9</trackback:ping></item><item><title>Asp.Net程序员与SEO – 庞大的反向链接网络(一)</title><author>abcily@126.com (Arain)</author><link>http://www.blog-design.cn/post/aspdotnet-seo-links-1.html</link><pubDate>Tue, 17 Mar 2009 22:59:47 +0800</pubDate><guid>http://www.blog-design.cn/post/aspdotnet-seo-links-1.html</guid><description><![CDATA[<p>讲到链接那我们就来接触几个概念，先看一下下面的反向链接网络图。 <br /><img title="" alt="" onload="ResizeImage(this,520)" src="http://www.blog-design.cn/upload/2009/3/links-1.gif" /><br /><strong>反向链接</strong><br />A网页中有一个链接指向B网页，那么A网页就是B网页的反向链接！如下图，所有链接都算反向链接。</p><p><strong>外部链接</strong><br />如上图中的①链接，其他网站给你网站的网页做的反向链接，叫外部链接。</p><p><strong>内部链接</strong><br />网站内部网页与网页之间的连接叫做内部链接。</p><p><strong>特别提醒</strong><br />反向链接是网页和网页之间的关系，不是网站与网站之间的关系。不管外部链接还是内部链接，都是反向链接，对搜索排名都是有影响的。可以在搜索引擎用link来进行查询，例如查我的blog就在搜索框输入&ldquo;link:www.blog-design.cn&rdquo;，便可以查到我blog的有效反向链接</p><p><strong>反向链接在<a target="_blank" href="http://www.blog-design.cn">SEO</a>中的影响</strong><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 反向链接在搜索引擎的权重是无庸质疑的高。按照Google的说法，PR值的计算有着非常复杂的算法，但是不用质疑的是，反向链接的数量和质量对PR值起着决定性的影响。如果你想获得比较高的PR值，一定要拥有一定数量的高质量的反向链接，或者足够量大的反向链接。查看网页的PR值，可以下载Google工具栏安装到你的浏览器上，这样的话，浏览任何网页，都可以直接看到它的PR值，这里给大家推荐一下。下载地址：<a href="http://toolbar.google.com/intl/zh-CN">http://toolbar.google.com/intl/zh-CN</a>.</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;讲了一些这样的概念相信大家对链接有了一定的了解。但我们作为程序员对SEO的增加反向链接能做些什么呢？那下篇文章就从增加反向链接的方法来谈谈我对此问题的一些看法。</p>]]></description><category>SEO与程序员系列</category><comments>http://www.blog-design.cn/post/aspdotnet-seo-links-1.html#comment</comments><wfw:comment>http://www.blog-design.cn/</wfw:comment><wfw:commentRss>http://www.blog-design.cn/feed.asp?cmt=140</wfw:commentRss><trackback:ping>http://www.blog-design.cn/cmd.asp?act=tb&amp;id=140&amp;key=74d88482</trackback:ping></item></channel></rss>
