c# - URL route configuration cannot deal with periods in url -


i have created mvc controller linked model file created ado.net wizard. id column isn't filled normal values integers or guids, strings can have periods. auto generated edit functionality gets screwed on because route engine takes character in id configuration , throws exception:

the resource looking has been removed, had name changed, or temporarily unavailable.

the edit action formated as:

// get: .../edit/5 public actionresult edit(string id) { //my code } 

and when url doesn't contain spec character (ie: /edit/2982-4-112a) works wonderfully, when contains periods (ie: /edit/125-2-10.5) exception follows.

i have tried adding web.config line

<httpruntime relaxedurltofilesystemmapping="true" />

didn't solve problem.

how 1 work around this?

i feel intercept parameter , exchange dot else until gets method @ point revert change. don't know how though.

at moment solution this:

at place links need generated string.replace('.','|') , again once action called string.replace('|','.').

still think there's better way though.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -