/// <summary> /// Returns a script that can be used to open a pop up window with the specified url and settings. /// </summary> public static string GetPopUpWindowScript( string url, Control urlResolver, PopUpWindowSettings settings ) { Func<bool, string> boolToYesNo = b => b ? "yes" : "no"; return "var popUpWindow = window.open( '{0}', '{1}', 'width={2},height={3},toolbar={4},location={5},status=no,resizable={6},scrollbars={7}' ); popUpWindow.focus();" .FormatWith( urlResolver.GetClientUrl( url ), settings.Name, settings.Width, settings.Height, boolToYesNo( settings.ShowsNavigationToolbar ), boolToYesNo( settings.ShowsLocationBar ), boolToYesNo( settings.IsResizable ), boolToYesNo( settings.ShowsScrollBarsWhenNecessary ) ); }