Duplicate header on ajax call

Pickley

New Member
Hi have created a link that executes an ajax call to a controller in order to update a span with the id UpdateCart.The problem is that if the user is not authentificated he get's sent to the Login page and this gets generated on the page:
VuWaI.gif
6m2n9.gif
As it can be seen from the images some how my entire header tag gets duplicated and added inside the span tag.This is my code:\[code\] @Ajax.ActionLink("Add To Cart" , "AddToCart" , "Products", new { ProductId = @products.ElementAt(0).Value }, new AjaxOptions{ InsertionMode = InsertionMode.Replace, UpdateTargetId = "UpdateCart", HttpMethod = "GET" })public ActionResult AddToCart(string ProductId) { if( User.Identity.IsAuthenticated ) { string username = User.Identity.Name; CartHelperClass.AddToCart(ProductId , username); ViewBag.ItemsInCart = CartHelperClass.CountItemsInCart(username); return PartialView("_AddToCart"); } else { return RedirectToAction("LogIn" , "Account" , new { returnUrl = "Products" }); } }\[/code\]How can I stop the creation of a duplicate header?
 
Back
Top