1

I have Jquery Ui Dialog Like this :

<script type="text/javascript">
    $(document).ready(function () {

        $(document).mousemove(function (e) {
            x = e.pageX;
            y = e.pageY;
            $("#d").dialog({
                autoOpen: false,
                show: "blind",
                hide: "explode",
                position: [e.pageX, e.pageY],

                open: function (type, data) {
                    //Fill Dialog From Server
                }

            });
        });

        $("#c").bind("mouseover", function () {
            $("#d").dialog('open'); // open
        });
        $("#c").bind("mouseleave", function () {
            $("#d").dialog('close'); // open
        });
    });
</script>

How can i load some data from server dynamic ? in asp.net

3
  • Where do you want to load some data? Commented Dec 29, 2010 at 8:48
  • into JQuery Ui dialog for example label into dialog or etc Commented Dec 29, 2010 at 8:50
  • in case you're gonna switch to asp.net mvc look here awesome.codeplex.com, at the Popup and PopupForm helpers Commented Dec 29, 2010 at 9:05

2 Answers 2

2

The call is fairly simple, just get ASP.Net to return only what content should be in the dialog, not an entire <html>....</html> page. The load can be as simple as using .load(), like this:

open: function () {
  $(this).load("MyDialogContent.aspx");
}

...or it can be a web service call which an return either HTML or JSON, etc...you have a lot of options here.

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

Comments

0

i found solution

<WebMethod()> _
Public Shared Function GetInfoByMprID(ByVal mprID As String) As String

    Return resualt
End Function

<script type="text/javascript">
    $(document).ready(function () {

        $(document).mousemove(function (e) {
            x = e.pageX;
            y = e.pageY;
            $("#d").dialog({
                autoOpen: false,
                width: 'auto',
                show: "blind",
                hide: "explode",
                position: [e.pageX, e.pageY],

                open: function (type, data) {
                    $.ajax({
                        type: "POST",
                        url: "Constants.aspx/GetInfoByMprID",
                        data: "{'mprID': '" + 158 + "'}",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (msg) {
                            //alert(msg.d);
                            //$('lbl').val() = msg.d;
                            $("#d").empty();
                            $("#d").append('<p>' + msg.d + '</p>');
                        },
                        error: AjaxFailed
                    });
                }

            });
        });

        $("#c").bind("mouseover", function () {
            $("#d").dialog('open'); // open
        });
        $("#c").bind("mouseleave", function () {
            $("#d").dialog('close'); // open
        });
    });
</script>

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.