You're starting to deal with the same things that I'm dealing with these days... although my control is a bit more complicated than what you're describing... I'm actually working on something very similar.
I'll let you know how I'm currently achieving this, however I haven't worked out all the kinks in every browser yet so when you hit the same problems that I'm having maybe you can help me ;)
First of all, make sure that you have your content within an UpdatePanel...otherwise the whole page will be updated instead of just the section that you want to be updated (the section containing the ListBox that is).
Add a button to this UpdatePanel and set it's style to "display:none;"....give it an ID and text...and call it something like "UpdateListBox". In the code that handles this button, do what is necessary to update the ListBox.
Before you display your modular extender, you'll have to cause the UpdateListButton to post back to the server. To do this you'll need to add a JavaScript function to the page:
-
function UpdateListBox(){
-
__doPostBack('<%=UpdateListBox.ClientID %>','');
-
}
The above code calls the ASP.NET __doPostBack function that will post back to the server. You pass it 2 parameters: the eventTarget, and eventArgument....in the above code you are passing it the ID of the UpdateListBox button as the eventTarget and nothing for the eventArgument.
(Please note that '<%= %>' is ASP short hand for the Response.Write() method..therefore this is actually executed server side. It writes the ClientID of the UpdateListBox button in its place when the HTML content is sent to the browser).
I use the __doPostBack method because it determines whether or not to do a full page postback or a partial page postback. There is another way to do this using the ASP.NET Ajax Framework/Class libraries but I'm not going to get into that because it's more restricting.
Now that you have a button within an UpdatePanel, and JavaScript that posts back to the server indicating that the UpdateListBox button is the eventTarget for the postback.....and the UpdateListBox button updates the ListBox....all you have to do is call the JavaScript function before the ModalPopupExtender displays the panel.
So, in a nutshell, that's the technique I'm using.
If you are using a pure WebMethod then you are going to have to do research on how to create a JavaScript proxy class in order to call the WebMethod.......which is more complicated and something that I haven't tried doing yet...but there's lots of information out there on the web that describes how to do this.
Cheers!
-Frinny