W3C Validation Not working for RazorView

≯℡__Kan透↙ 提交于 2020-01-24 20:22:04

问题


I am using MVC4 project and doing URL rewrite on Server side in RouteConfig and appending .html at the end of url of every page..

www.mysite.com/home.html

I have couple of pages and those pages are linked with home page (every think is working find in browser).

But when I validate using W3C link checker, I get broken link error message.

I really don't know what can be issue. One more thing if I replace .html with .aspx or any other extension it is validated by W3C. I don't know what is issue.

My code is:

 routes.MapRoute(
                name: "features",
                url: "features.html",
                defaults: new { controller = "Home", action = "features", page =    UrlParameter.Optional }
            ); 

Web.config:

<add name="HtmlFileHandler" path="*.html" verb="GET" 
     type="System.Web.Handlers.TransferRequestHandler" 
     preCondition="integratedMode,runtimeVersionv4.0" />

Any help is highly appreciated


回答1:


Ok I solved it some what like this.

I replaced

<add name="HtmlFileHandler" 
     path="*.html" 
     verb="GET"
     type="System.Web.Handlers.TransferRequestHandler"
     preCondition="integratedMode,runtimeVersionv4.0" />

in webconfig with

<add name="HtmlFileHandler" 
     path="*.html" 
     verb="*" 
     type="System.Web.UI.PageHandlerFactory" />

and it works ... my page is validated by W3C now. :)



来源:https://stackoverflow.com/questions/24096868/w3c-validation-not-working-for-razorview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!