I am calling a jQuery Modal Dialog function from ASP.Net and I am passing some parameters to it. One of the parameters contains a # symbol across and for this reason, the jQuery modal dialog call does not execute.
What's the way to resolve this problem? I tried escaping the character by doing a replace of the string '#' with this '\#' but still doesn't work out.
Thanks.
Code from the top of my head..
String var1 = "#3 and #4 should be on the list.";
lnkDetails.OnClientClick = "openDialog('" + var1 + "');
And the normal jQuery dialog function:
function openDialog(varPassed) {
$("#divModal").dialog({
width: 600,
});
$('#<%= label1.ClientID %>').text(varPassed);
Update: It seems the modal does not show up because of this line:
$('#<%= label1.ClientID %>').text(varPassed);
When the value being assigned to the label which is inside the div of the modal dialog itself, the modal window does not show up.
This is the modal window.
<div id="divMaterialDetails" title="Material Details" style="display:none" >
<asp:Label ID="label1" runat="server" CssClass="formLabel"/>
</div>
If I commented out the assignment of the value, the modal shows up.
So how would I be able to assign the value passed to the modal to the label so that the modal would show up?