Dynamically building request behavior in IE and FF / Chrome

This code

function LoadContent(Id) {
        alert('Controls/Network/NetworkDetail.aspx?' + rnd() + '&CtlId=' + Id);
        $.get('Controls/Network/NetworkDetail.aspx?' + rnd() + '&CtlId=' + Id, function(data) {
            $(Id).append(data);
        });
        $(Id).removeClass("Waiting");
}

      

works great in IE7. the warning displayed by the intended request and the NetworkDetail.aspx page can get the CtlId using Request.QueryString ["CtlId"]

However, using FF3 and Chrome, Request.QueryString ["CtlId"] returns null, but the alert displays the request correctly (no difference from IE7).

the Id value is usually # Tab1 or "# Tab2"

Any idea on how to build the querystring correctly?

0


source to share


1 answer


# indicates a named anchor in HTML and is therefore not part of the request, it is possible that you are URL-encoding your ID correctly.

eg. # Tab1 becomes% 35Tab1



Try using escape. eg.

"Control / Network / NetworkDetail.aspx? + Rnd () + '& CtlId =' + escape (Id)

+5


source







All Articles