Click here to Skip to main content
15,886,632 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am developing a mobile website in MVC4 (using Razor view Engine).
The issue I am facing is that When I navigate to different View using RedirectToAction() method, the new view is served but the URL remains the same in the browser.

I searched about it and found that If I disable the AJAX on my page (by setting attribute [data-ajax=false]) then It start working fine(i.e. correct URL is displayed). But Ajax stops working.

But my problem is that I can not disable AJAX for mobile website & I need to display correct URL for each page.

Please help if you can asap.

Thanks.
Posted

1 solution

May be you can try to sent the submit/redirect code call as non-ajax using data_ajax = "false"

Try:
HTML
@using (Html.BeginForm("Login", "Home", FormMethod.Post, new { data_ajax = "false" }))
 
Share this answer
 
Comments
tusDev1 10-Oct-12 23:54pm    
Hi Sandeep,
Thanks, I have tried this. But my problem is that I have to use AJAX, when I use your suggestion it stops the AJAX on page.
Any Ideas how to achive correct URL display in AJAX?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900