0

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);
    }

1 Answer 1

1

Pass parameter in query string like

function ShowGraph(sId) {
              var oid = sId;
             $("#dialog")
               .load('Graph.aspx?sId='+sId)

             $('#dialog').dialog('open');
        }

and on page load event you can get it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.