在线等,虚心求教我重写URL为什么不能成功,为什么??? 我在http://www.microsoft.com/china/msdn/library/webservices/asp.net/URLRewriting.mspx?mfr=true下载了源代码,然后把.dll在项目中引进来,然后在web.config里设置一下,就能实现url重写,我在百度搜索asp.net 重写url几乎每篇文章都这么写,我也这么去做,可是就是不能实现url????做过url兄弟帮帮看看,问题解决了立即揭贴!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ASP.NET 2.0: URL Mapping with RegEx Supporthttp://pietschsoft.com/blog/post.aspx?postid=7621.1网上很多例子了.要注意IIS,web.config等的设置 同意楼上的,网上好多例子http://workgroup.cn/CS/blogs/aspnet/archive/2006/07/07/1441.aspx 是不是你的适配写的有问题?贴出来看看??或者你没把IIS配置里面的"确认文件是否存在的"勾去掉 注意把你要重写的url的后缀*.xxx要在IIS里做映射 ccwq(Wind Love Rove Forever) ( ) ---------------------------------------------或者你没把IIS配置里面的"确认文件是否存在的"勾去掉,我来看看去掉,谢谢!! littlelam(比菜鸟还要菜的鸟)(http://www.toaspx.com) ( ) 信-----------------已经影射了 "确认文件是否存在的"勾去掉还是不行__________________<?xml version="1.0" encoding="utf-8" ?><configuration> <configSections> <!-- The <configSections> element must contain a <section> tag for the <RewriterConfig> section element. The type of the section handler is RewriterConfigSerializerSectionHandler, which is responsible for deserializing the <RewriterConfig> section element into a RewriterConfig instance... --> <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" /> </configSections> <RewriterConfig> <Rules> <!-- Rules for Product Lister --> <RewriterRule> <LookFor>~/Products/Default\.aspx</LookFor> <SendTo>~/ListCategories.aspx</SendTo> </RewriterRule> <RewriterRule> <LookFor>~/Products/Beverages\.aspx</LookFor> <SendTo>~/ListProductsByCategory.aspx?CategoryID=1</SendTo> </RewriterRule> <RewriterRule> <LookFor>~/Products/Condiments\.aspx</LookFor> <SendTo>~/ListProductsByCategory.aspx?CategoryID=2</SendTo> </RewriterRule> <RewriterRule> <LookFor>~/Products/Confections\.aspx</LookFor> <SendTo>~/ListProductsByCategory.aspx?CategoryID=3</SendTo> </RewriterRule> <RewriterRule> <LookFor>~/Products/Dairy\.aspx</LookFor> <SendTo>~/ListProductsByCategory.aspx?CategoryID=4</SendTo> </RewriterRule> <RewriterRule> <LookFor>~/Products/GrainsCereals\.aspx</LookFor> <SendTo>~/ListProductsByCategory.aspx?CategoryID=5</SendTo> </RewriterRule> <RewriterRule> <LookFor>~/Products/MeatPoultry\.aspx</LookFor> <SendTo>~/ListProductsByCategory.aspx?CategoryID=6</SendTo> </RewriterRule> <RewriterRule> <LookFor>~/Products/Produce\.aspx</LookFor> <SendTo>~/ListProductsByCategory.aspx?CategoryID=7</SendTo> </RewriterRule> <RewriterRule> <LookFor>~/Products/Seafood\.aspx</LookFor> <SendTo>~/ListProductsByCategory.aspx?CategoryID=8</SendTo> </RewriterRule> </Rules> </RewriterConfig> <system.web> <httpHandlers> <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> </httpHandlers></system.web> <system.windows.forms jitDebugging="true" /></configuration> 要在web.config设置httpModules,不是httpHandlers gyf19(秋天的云)----------------------------设置httpModules也不行,真是急死了 1:.html 要在IIS里设置一下,跟.aspx一样2:.dll文件放到bin里3:() 代表一个变量,对应一个$n如 <LookFor>~/Products/Seafood/([\d]*)\.html</LookFor> <SendTo>~/products.aspx?name=seafood&id=$1()里的正则表达式跟$1是对应的,有几个(),就对应几个$n... 3des .NET取另外一个数据库的数据出错 .net 页面局部刷问题,求教! 查询数据库之前把密码md5加密 C#使用Struct类型 各位救急!! 关于在fckeditor在线编辑器中插入rar、word、zip等文件,然后上传到服务器供别人下载这些文件的问题。 c#中如何设置XMLHTTP超时? 兄弟第一次用 .net 这个错误怎么解决,谢谢!! 调试asp.net程序,出错:“HTTP 500 - 内部服务器错误 ”,IIS正常,请帮忙解决,在线等。 ~~ 高分 求~~~~项目报价问题!! 数据绑定后不显示链接????
http://pietschsoft.com/blog/post.aspx?postid=7621.1网上很多例子了.要注意IIS,web.config等的设置
---------------------------------------------
或者你没把IIS配置里面的"确认文件是否存在的"勾去掉,我来看看去掉,谢谢!!
-----------------
已经影射了
__________________
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<!-- The <configSections> element must contain a <section> tag for the <RewriterConfig> section element.
The type of the section handler is RewriterConfigSerializerSectionHandler, which is responsible for
deserializing the <RewriterConfig> section element into a RewriterConfig instance... -->
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<!-- Rules for Product Lister -->
<RewriterRule>
<LookFor>~/Products/Default\.aspx</LookFor>
<SendTo>~/ListCategories.aspx</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/Products/Beverages\.aspx</LookFor>
<SendTo>~/ListProductsByCategory.aspx?CategoryID=1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/Products/Condiments\.aspx</LookFor>
<SendTo>~/ListProductsByCategory.aspx?CategoryID=2</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/Products/Confections\.aspx</LookFor>
<SendTo>~/ListProductsByCategory.aspx?CategoryID=3</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/Products/Dairy\.aspx</LookFor>
<SendTo>~/ListProductsByCategory.aspx?CategoryID=4</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/Products/GrainsCereals\.aspx</LookFor>
<SendTo>~/ListProductsByCategory.aspx?CategoryID=5</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/Products/MeatPoultry\.aspx</LookFor>
<SendTo>~/ListProductsByCategory.aspx?CategoryID=6</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/Products/Produce\.aspx</LookFor>
<SendTo>~/ListProductsByCategory.aspx?CategoryID=7</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/Products/Seafood\.aspx</LookFor>
<SendTo>~/ListProductsByCategory.aspx?CategoryID=8</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<system.web>
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>
</system.web>
<system.windows.forms jitDebugging="true" />
</configuration>
----------------------------
设置httpModules也不行,真是急死了
2:.dll文件放到bin里
3:() 代表一个变量,对应一个$n如 <LookFor>~/Products/Seafood/([\d]*)\.html</LookFor>
<SendTo>~/products.aspx?name=seafood&id=$1()里的正则表达式跟$1是对应的,有几个(),就对应几个$n...