How do I retrieve a return value from the server to use in $.ajax success?

How do I retrieve a return value from the server to use in $.ajax success?

I am using this code in c#. I need to create a url dynamically which the following code does. The BuildURL method has a string return and returns the build URL. How do I get that value and use it in the following code? Thanks for the help.

$("#myButton").bind('click', function() {
        $.ajax({
            type: "POST",
            url: "../Controllers/myController.asmx/BuildURL",
            success: function() {
                $("#myPopup").dialog("close");
                window.open('the newly built url returned from controller');
            }
        });
    });