I am working on a MVC project using Ext.Net TreeGrid. I have the treegrid on a page "PieChart2". When I first load PieChart2, I load the tree with root nodes. When I click on one of the nodes I want to pass the node id in the same url (/Home/PieChart2/nodeid).I am trying achieve this by redirecting to a URL using the following code in the click event of the treegrid.
idVal is node id of the treenode that was clicked.
string newUrl = "/Home/PieChart2/" + idVal ;
Response.RedirectToRoutePermanent("PieRoute", new { id = idVal });
PieRoute looks like this in Global.asax.
routes.MapRoute("PieRoute", "{controller}/{action}/{id}", new { controller = "Home", action = "PieChart2", id = UrlParameter.Optional });
I see two requests to the server on redirection 1) 301 status code with original URL and 2) the new URL. The Url is processed correctly also, but the browser still shows "/Home/PieChart2" instead of "Home/PieChart2/nodeid".
Am I doing it the right way? If yes, what could be the reason for it to not work?