While working with some jQuery ajax, I've run into this problem with Chrome and Firefox not passing a querystring value with jquery load()
Here is the markup:
<a href="#" class="abort-invitation" id='abort-invitation-103'>abort</a>
The jquery script:
$('a.abort-invitation').live(
{
click: function (e) {
var $link = $(this);
var querystringValue = $link.html();
var randomnumber = new Date().getTime();
var urlPath = '<%:Url.Action("AbortInvitation", "Evaluation") %>' + '?
inviteState=' + querystringValue + '&ran=' + randomnumber;
var $modal = GetModal();
$modal.load(urlPath);
// more javascript ...
The MVC method being called on load():
public PartialViewResult AbortInvitation()
{
ViewData["inviteState"] = Request.QueryString["inviteState"];
var randomValue = Request.QueryString["ran"];
return PartialView("~/views/evaluation/controls/AbortOrReactivate.ascx");
}
While debugging in Visual Studio ViewData["inviteState"] will give me a value when load is fired from IE(8), and in Chrome(16.0) and FireFox(8) I will get "" as the passed in value. Does anyone have a clue or a solution for why one browser works as expected, and the other two fail at passing the querystring value?
(Note: most of the vars are just my attempt at trying to isolate the problem and break things down one at a time. The random number is attached in case there is some caching going on. We only really care about the var 'querystringValue' itself.)
querystringValuevariable have a value if you debug in chrome?