operating system - reserved keywords like CON, PRN, NUL in URL in ASP.net MVC -


i tried hit url id con in asp.net mvc.

routing

routes.maproute(             "default", // route name             "{controller}/{action}/{id}", // url parameters             new { controller = "home", action = "index", id = urlparameter.optional }// parameter defaults                       ); 

its giving following error

2015-04-29 08:25:22,325 [8] fatal myapplication.global - application error === (null) system.web.httpexception (0x80004005)    @ system.web.cachedpathdata.getphysicalpath(virtualpath virtualpath)    @ system.web.cachedpathdata.getconfigpathdata(string configpath)    @ system.web.httpcontext.getfilepathdata()    @ system.web.httpcontext.getruntimeconfig()    @ system.web.httpcontext.get_impersonationtoken()    @ system.web.clientimpersonationcontext.start(httpcontext context, boolean throwonerror)    @ system.web.threadcontext.associatewithcurrentthread(boolean setimpersonationcontext)    @ system.web.httpapplication.onthreadenterprivate(boolean setimpersonationcontext)    @ system.web.httpapplication.applicationstepmanager.resumesteps(exception error) 

there couple of reserved keywords con, prn, nul, , others (these left in windows os family backwards compatibility believe). add web.config:

<system.web>     <httpruntime relaxedurltofilesystemmapping="true"/>      ...... </system.web> 

it should fix issue.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -