Upto .NET Framework 4.5 we cannot create .zip files. In .NET Framework 4.5
it is now possible. Following is example for creating zip file and extracting zip file
from and to folder.

Async and Await keywords used for asynchronous programming in C#.

There are times when being able to limit the pattern matching duration of Regex operations could be useful, especially when working with user supplied patterns to match data.
The MatchTimeout property defines the approximate maximum time interval for a Regex instance to execute a single matching operation before the operation times out. The regular expression engine throws a RegexMatchTimeoutException exception during its next timing check after the time-out interval has elapsed. This prevents the regular expression engine from processing input strings that require excessive backtracking. 
This property is read-only. You can set its value explicitly for an individual Regex object by calling the Regex.Regex(String, RegexOptions, TimeSpan) constructor; and you can set its value for all Regex matching operations in an application domain by calling the AppDomain.SetData method and providing a value for the 
“REGEX_DEFAULT_MATCH_TIMEOUT” property. If you do not explicitly set a timeout interval, the default value Regex.InfiniteMatchTimeout is used, and matching operations do not time out.

We can achieve this using CustomReflectionContext class. provides a way for you to add or remove custom attributes from reflection objects, or add dummy properties to those objects, without re-implementing the complete reflection model. The default CustomReflectionContext simply wraps reflection objects without making any changes, but by subclassing and overriding the relevant methods, you can add, remove, or change the attributes that apply to any reflected parameter or member, or add new properties to a eflected type.

Inside the application domain when threads get created, threads gets default culture from windows initialized from the system default locale as configured in control panel > region and language settings. But with .NET Framework 4.5 it is possible to provide default culture for an application domain using DefaultThreadCurrentCulture and CurrentUICulture properties of CultureInfo class.

By default, the StringComparer class and the string.GetHashCode method use a single hashing algorithm that produces a consistent hash code across application domains. This is equivalent to setting the enabled attribute of the element to 0. This is the hashing algorithm used in the .NET Framework 4. The StringComparer class and the String.GetHashCode method can also use a different hashing algorithm that computes hash codes on a per application domain basis. As a result, hash codes for equivalent strings will differ across application domains. This is an opt-in feature; to take advantage of it, you must set the enabled attribute of the element to 1.

 From the .NET Framework 2.0 Service Pack 1 through the .NET Framework 4, each version of the.NET Framework has included tables that contain sort weights and data on string normalization and that are based on a particular version of Unicode. In the .NET Framework 4.5, the presence of these tables depends on the operating system:

  • On Windows 7 and previous versions of the Windows operating system, the tables continue to be used for comparing and ordering strings.
  • On Windows 8, the .NET Framework delegates string comparison and ordering operations to the operating system.
  • Consequently, the result of a string comparison can depend not only on the .NET Framework version, but also on the operating system version, as the following table shows:
  1. .NET Framework version Operating system Unicode version
  2. .NET Framework 4 All operating systems Unicode 5.0
  3. NET Framework 4.5 Windows 7 Unicode 5.0
  4. NET Framework 4.5 Windows 8 Unicode 6.0
  • On Windows 8, because the version of Unicode used in string comparison and ordering depends on the version of the operating system, the results of string comparison may differ even for applications that run on a specific version of the .NET Framework.
The SortVersion class provides information about the Unicode version used by the .NET Framework for string comparison and ordering. It enables to write applications that can detect and successfully handle changes in the version of Unicode that is used to compare and sort an application’s strings. The following example contains a portion of the source code from an application that uses the SortVersion class to ensure that the native names of RegionInfo objects are ordered appropriately for the current system and current culture.

There are not that many tools out there that will support both client-side and server-side debugging. Below is some information on the client-side debuggers on some of the commonly used browsers-
Firefox/Mozilla/Netscape - Have a built in debugger Venkman which can be helpful but there is a Firefox add on known as FireBug which provides all the information and AJAX developer would ever need including the ability to inspect the browser DOM, console access to the JavaScript runtime in the browser, and the ability to see the HTTP requests and responses (including those made by an XMLHttpRequest). I tend to develop my applications initially on Firefox using Firebug then venture out to the other browsers. 
Safari - Has a debugger which needs to be enabled. See the Safari FAQ for details. 
Internet Explorer - There is MSDN Documentation on debugging JavaScript. A developer toolbar for Internet Explorer may also be helpful. While debuggers help a common technique knowing as "Alert Debugging" may be used. In this case you place "alert()" function calls inline much like you would a System.out.println. While a little primitive it works for most basic cases. Some frameworks such as Dojo provide APIs for tracking debug statements.

Sometimes, we required to show all items in Gridview or repeater but we do not want to implement paging. In this case, a scrolling grid is more applicable and enclosing the GridView in a Panel control or <div> tag with the overflow style applied ensures that the over-sized element is clipped and that scroll bars are displayed.
This solution works fine but whenever a postback occurs on page the div gets back to its original starting position. Here in this example, In order to maintain the scrolled position after postback I stored the div scroll value in hiddenfield using jquery and after postback we can get the scroll value from hiddenfield and set back to div to maintain the scroll position after asynchronous postback.

Need Help? Contact Us.

Log in

*
*

Forgot password?

*

New User

*
*
*
*