June 2008 Entries

Store custom objects configuration in separate custom configuration files

We are going to have a windows service that will run a few workflow(WF) instances. I want to have configuration information to be stored in separate config files for each WF instance. I remembered that EntLib has helper classes to store custom objects configuration in separate custom configuration file, but finding good examples in Google wasn't easy(probably I didn't find good search keywords). The links that I finally found(more relevant to the task first) Tom Hollander 'post External configuration...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Override ASP.NET Menu javascript functions to delay dynamic menus popup.

We are using asp.net Menu control and wanted to have some delay before sub-menu popup to avoid annoying popup, if user just move mouse through menu area. After some search on Google I found the solution submitted by yupinggang on the thread delaying the menu control. I've slightly modified it( put in a separate JS file,call initMenuMouseHoverInterceptors just in the same file,added handling of the case if no menu on the page etc.) Another possible solution- override PreRender in derived from Menu...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Helper String function to TrimLength

/// <summary> /// If lenght of the string is greater than max allowed, remove the end /// </summary> /// <param name="str"></param> /// <param name="maxLength"></pa... /// <returns></returns... public static string TrimLength(string str, int maxLength) { if (str.Length > maxLength) { str = str.Remove(maxLength); } return str; }...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Helper function to Print Page using JScript(including inside frame)

///<summary> /// Helper function to Print Page using JScript(including inside frame) ///</summary> ///<param name="page"></param> public static void PrintPage(Page page) { //In case if page is in frameset, you need to call parent.window.print() String script = @" if (parent!= self) { parent.window.print(); } else { window.print(); } "; RegisterOnceStartupScript(p... MethodBase.GetCurrentMethod... } public static bool RegisterOnceStartupScript(Page...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

«June»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345