It would be incredibly helpful to add the AutoCloseDelay and ShowInterval properties to the Show function of the RadNotification control so I wouldn't have to add a wrapper to my base page class.
At this point I decided that I am not going to implement public void Show (int AutoCloseDelay , int ShowInterval) method of RadNotification. The usage of such method is too ambiguous (this includes the client side as well). There are too many unexpected behaviors. Will the parameters overwrite the predefined AutoCloseDelay and ShowInterval properties. Some clients might want to overwrite them, others not. Some might want to overwrite only the first one for example. Since the point is the RadNotificataino not to be wrapped in an inheriting class, one approach for achieving the functionality is the following static utility class,method. public static class RadNotificationUtils { public static void ShowNotificataion(Page page, RadNotification notification, int AutoCloseDelay , int ShowInterval) { //use a unique id for the script block to be able to manually remove it from the head after execution string scriptBlockName = Guid.NewGuid().ToString().GetHashCode().ToString("x"); //add unique sufix to the name in case two dialogs from the same type are opened just one after the other string name = notification.ClientID + scriptBlockName; //add and remove the function to the load event; do the same for the script element string script = String.Format(@" <script type='text/javascript' id='{2}'> function {0}() {{ var n = $find('{1}'); n.set_autoCloseDelay({3}); n.set_showInterval({4}); alert(n.get_autoCloseDelay()); alert(n.get_showInterval()); n.show(); Sys.Application.remove_load({0}); var scriptBlock = document.getElementById('{2}'); if(scriptBlock) {{ var parent = scriptBlock.parentNode; if(parent) parent.removeChild(scriptBlock); }} }}; Sys.Application.add_load({0}); </script>", name, notification.ClientID, scriptBlockName, AutoCloseDelay, ShowInterval); ScriptManager.RegisterStartupScript(page, page.GetType(), scriptBlockName, script, false); } }
I would want it in the server side Show function as I have a pretty elaborate server side setup connected into multiple WCF Services.
Just to be sure, which show method are you referring? The client or the server side? The overload word in the caption is pointing the server side, however I need this to be confirmed.