zoukankan      html  css  js  c++  java
  • 遭遇Intelligencia.UrlRewriter

    UrlRewriter.Net重定向开源项目.

    使用心得:

    1.配置.

    web.config里加三个节点:

    1). 加入UrlRewriter的配置

    <configSections>
        <section name="rewriter" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
    </configSections>

    2).   UrlRewriter的配置

      <rewriter>
        <if url="(.*)\.html(.*)" rewrite="$1.aspx$2"/>
        <if url="(.*)fckeditor/editor/(.*)\.aspx(.*)" rewrite="$1fckeditor/editor/$2.html$3"/>
      </rewriter>

    说明:这里定义转换规则,顺序执行.也就是说在越前面的可以定义越广的泛围.个别情况可以在后面的规则中再做调整.按这个理解,规则应该是越少越好,以免影响效率.

    3).  使用 在system.web

        <httpModules>
          <add type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" name="UrlRewriter"/>
        </httpModules>

    2.对Form的action的处理.使用UrlRewriter定义的Form,以达到PostBack的时候,保持Url的效果.

    1)引用.在Page.aspx

    <%@ Register TagPrefix="UR" Namespace="Intelligencia.UrlRewriter" Assembly="Intelligencia.UrlRewriter" %>

    2). 使用Form:

     <UR:form  id="from1" runat="server" >

    </UR:form >

  • 相关阅读:
    leetcode 851. Loud and Rich
    674. 最长连续递增序列
    896. 单调数列
    905. 按奇偶排序数组
    917. 仅仅反转字母
    922. 按奇偶排序数组 II
    925. 长按键入
    929. 独特的电子邮件地址
    933. 最近的请求次数
    自己动手丰衣足食写java贪吃蛇
  • 原文地址:https://www.cnblogs.com/greatqn/p/627621.html
Copyright © 2011-2022 走看看