You can use a helper class with static method:
public static class PageHelper {
public static void RegisterClientScriptIfNeeded( Page page, string key, string url ) {
if( false == page.IsClientScriptBlockRegistered( key )) {
page.ClientScript.RegisterClientScriptInclude( key , ResolveClientUrl( url ));
}
}
}
or you can have a similar instance method in some base class for page/webcontrol/usercontrol, which will do the same thing.
TcKs
2008-09-24 15:38:20