c# - Change part of the pathname in url using jquery -


i working in application using localization. localization both admin , user can change language. if admin changed recently, change affected users.

for ex, admin changed language en-us, url http://localhost:81/en-us/form

then, if user trying change language, http://localhost:81/fr-fr/form this, need redirect http://localhost:81/en-us/form. need change part alone in pathname.

i have tried like,

 if (!data.status)   {   // data.data contains ("en-us") part of url   var url = window.location;   url.replace("/" + data.data, "/" + window.location.pathname.split('/')[1]);  } 

so, url changing http://localhost:81/en-us not http://localhost:81/en-us/form.

if try in c# url like, url wil http://localhost:81/controller/view?languagetag=en-us/something

how can change part alone ??

any idea achieve in script or suggest me in c#.


Comments