Using a colon (:) in a url with ASP.NET/IIS

前端 未结 8 2283
醉话见心
醉话见心 2020-12-05 19:14

I\'m implementing a custom controller in ASP.NET MVC and really want to be able to use a colon in the urls, so that I can identify class/column names and their valu

相关标签:
8条回答
  • 2020-12-05 19:52

    I would suggest using a period. REST, based on HTTP protocol, is an example of building a new use for HTTP that kept to standards and was highly successful. Perhaps you can do that.

    AND a '.' is a standard 'class.method' or 'class.attribute' in many langauges.

    Now ME, I wanted to use the colon in time URL parameters, and some places are doing it. I still have to see if I can get away with it.

    PS, for me, I may use this: http://www.businesscasualblog.com/2009/07/how-to-share-a-link-to-a-specific-timecode-in-youtube-video.html

    esentially '--h--m--s'

    0 讨论(0)
  • 2020-12-05 19:53

    Try setting HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters\AllowRestrictedChars. This is from http://support.microsoft.com/?id=820129. I don't know whether ASP.NET/MVC does some checking on their own but if it's only http.sys blocking you, this should fix it.

    0 讨论(0)
提交回复
热议问题