Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
We are developing a single page app, and I'm hijaking the routes so that all the pages are correctly rendered with the follwing code:
[HttpGet] public override ActionResult Index(RenderModel model) {
//Do some stuff here, the return the base Index method var template = ControllerContext.RouteData.Values["action"].ToString(); if (Request.QueryString != null) { foreach (string item in Request.QueryString.Keys) { if (TempData.ContainsKey(item)) { TempData.Add(item, Request.QueryString[item]); } } } if (Request.Headers["custom-ajax-request"] != null || model.Content.DocumentTypeAlias == "HtmlTextPage") { if (model.Content.DocumentTypeAlias == "HomePage") { return View("HomePageAjax", model); } else { return base.Index(model); //return View(template, model); } } else { var umbracoHelper = new UmbracoHelper(UmbracoContext.Current); var hp = model.Content.AncestorOrSelf("HomePage"); return View(hp.GetTemplateAlias(), CreateRenderModel(hp)); } }
But when we make a call with a querystring, this in not available on HttpContext, can someone help me on this?
Thx!
Alberto
That's strange. Querystrings should work. Are you doing something special why it might not work?
Jeroen
Yep, the special thing is my stupidity!
We are using jQuery Address, and instead of using the event.value that has the path and querystring, we used the event.path, that only gives the path...
Sigh... so many hours lost :D
Berto
Good old jQuery Address. I've been using it on some websites too and this sounds familiar ;-). Glad you got it fixed :-).
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Hijack umbraco routes and querystring
Hi,
We are developing a single page app, and I'm hijaking the routes so that all the pages are correctly rendered with the follwing code:
[HttpGet] public override ActionResult Index(RenderModel model) {
But when we make a call with a querystring, this in not available on HttpContext, can someone help me on this?
Thx!
Alberto
That's strange. Querystrings should work. Are you doing something special why it might not work?
Jeroen
Yep, the special thing is my stupidity!
We are using jQuery Address, and instead of using the event.value that has the path and querystring, we used the event.path, that only gives the path...
Sigh... so many hours lost :D
Thx!
Berto
Good old jQuery Address. I've been using it on some websites too and this sounds familiar ;-). Glad you got it fixed :-).
Jeroen
is working on a reply...