GeoMaps with web user control

326 views Asked by At

I'm trying to use geomap to view the location.. I'm using this code

    function OnLoad() {
        $.ajax({
            type: "POST",
            **url: "CS.aspx/CreateWorldMap"**,
            data: '{}',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: DrawWorldMap
        });
    }

where CS.aspx is aspx page and CreateWorldMap is a function inside this page.. Can anyone suggest How can i use usercontrol in the url propety instead of this aspx page.??

bcoz i have to integrate this in an opensource site which only accepts usercontrols not a web page..

Thank you..

1

There are 1 answers

0
apros On BEST ANSWER

In my opinion there exists only one way: Make a static method inside your page code-behind which will call actually UserControl method. So, in user control define

public void DoSomething()
{
   // do smth.
}

in your page create:

   [WebMethod]
   public static void DoSomething()
   {
       UserControl1.DoSomething();
   }

and load it with your code