javascript - How to reload page without _layout query string parameter -


page url in form

http://example.com/myapp?param1=1&otherparam=somevalue1&_layout=somevalue2&someother=something 

page contains button "reset layout" invokes javascript code:

        window.location.reload(); 

how reload page without _layout=somevalue2 parameter ? possible/reasonable use javascript ? asp.net mvc3 application. if javascript not reasonable, how call server side controller ?

jquery , bootstrap 3 used.

you can use regular expression , remove instance of _layout

  location.href=location.href.replace(/&?_layout=([^&]$|[^&]*)/i, ""); 

Comments

Popular posts from this blog

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -