简体   繁体   中英

GeoMaps with web user control

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..

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM