I'm using jQuery Mobile on an MVC 3 website. Working well except that I have an tag that links to a controller action that returns a RedirectResult. It looks like jQuery is intercepting the link and it errors out every time. I get the standard "An error has occurred" message that the mobile framework outputs. Inspecting the response with Firebug shows the response is totally empty.
I've heard there might be a data- attribute I need to add to the tag to make the mobile UI ignore it? Any ideas on that or other solutions?
EDIT: Just for clarification, the URL is being generated correctly and is a valid URL, it has something to do with the way jQUery mobile is intercepting the request.
<a href='/[email protected]["URL"]' title="view full site" >view full site</a>
public RedirectResult FullSite()
{
StringBuilder redirectUrl = new StringBuilder("http://www.site.com/");
try
{
string referringUrl = Request.QueryString["p"];
if (!String.IsNullOrEmpty(referringUrl) && referringUrl.Contains("photo-gallery"))
referringUrl = referringUrl.Replace(@"/photo-gallery", String.Empty);
redirectUrl.Append(referringUrl);
}
catch (Exception)
{
redirectUrl.Clear();
redirectUrl.Append("http://www.site.com");
}
CookieManager.SetMobileToFullSiteCookie();
return new RedirectResult(redirectUrl.ToString());
}