views:

193

answers:

1

I have a user control that I use in two different places (hence I created a control). Now, this control uses Web Method that I use to clear session from JS. The only problem is that I don't seem to find a way to include ScriptManager inside the ascx itself - only on the pages that host this control, which is prone to error and defeats the purpose, and just seems wrong.

Is there a way to define ScriptManager inside the ascx and define Web Method as you normally would, in the code behind of the control itself? Thanks!

I use .net 3.5, c#

+1  A: 

Have a look at the ScriptManagerProxy, it enables you to have your single ScriptManager on the page (or in a master page) and then add additional function with your user controls.

Mark Redman