I am trying to pass parameters to Jquery UI dialog for the new page. The new page has Page_Load method which connects to the database and displays the data. I am having issue with Page_Load method getting called first before $(document).ready. So parameter is empty. I appreciate any suggestions.
MainPage.aspx:
function ShowGraph(sId) {
var oid = sId;
$("#dialog")
.load('Graph.aspx')
.data("sId", sId)
$('#dialog').dialog('open');
}
<div id="dialog" title="My Dialog Title">
</div>
Graph.aspx:
$(document).ready(function () {
$get('<%= HiddenId.ClientID %>').value = $("#dialog").data('sId');
});
<asp:HiddenField runat="server" id="HiddenId"></asp:HiddenField>
code behind
protected void Page_Load(object sender, EventArgs e)
{
BL.GetNumbers(HiddenId.Value);
}