Last post Jun 03, 2011 06:27 AM by Shakti Singh Tanwar
Jun 03, 2011 03:14 AM|thakkermukund123|LINK
In .Net Framework 4.0, the major configuration elements have been moved to the machine.config file, and applications now inherit these settings. This allows web.config file to be empty
or contains 2 or 3 customized entry.
. In ASP.NET, developers have traditionally handled requests to old URLs by using by using the Response.Redirect method to forward a request to the new URL. However, the Redirect method
issues an HTTP 302 Found (temporary redirect) response, which results in an extra HTTP round trip when users attempt to access the old URLs.
ASP.NET 4 adds a new RedirectPermanent helper method that makes it easy to issue HTTP 301 Moved Permanently responses, as in the following example:
ASP.NET provides two default options for storing session state across a Web farm: a session-state provider that invokes an out-of-process session-state server, and a session-state provider
that stores data in a Microsoft SQL Server database. Because both options involve storing state information outside a Web application's worker process, session state has to be serialized before it is sent to remote storage. Depending on how much information
a developer saves in session state, the size of the serialized data can grow quite large.
ASP.NET 4 introduces a new compression option for both kinds of out-of-process session-state providers. When the
compressionEnabled configuration option shown in the following example is set to
true, ASP.NET will compress (and decompress) serialized session state by using the .NET Framework
sqlConnectionString="data source=servername;Initial Catalog=aspnetstate"
allowCustomSqlDatabase="true" compressionEnabled="true" />
ASP.NET 4 introduces new options for expanding the size of application URLs. Previous versions of ASP.NET constrained URL path lengths to 260 characters, based on the NTFS file-path limit.
In ASP.NET 4, you have the option to increase (or decrease) this limit as appropriate for your applications, using two new
httpRuntime configuration attributes. The following example shows these new attributes.
ASP.NET 4 also enables you to configure the characters that are used by the URL character check.
When ASP.NET finds an invalid character in the path portion of a URL, it rejects the request and issues an HTTP 400 error.
<httpRuntime maxRequestPathLength="260" maxQueryStringLength="2048"
Menu control will Render in <ul> and <li> instead of table. You can specify its property Renderingmode="list"
In order to increase the number of Web sites that can be hosted on a single server, many hosters run multiple ASP.NET applications in a single worker process. However, if multiple applications
use a single shared worker process, it is difficult for server administrators to identify an individual application that is experiencing problems.
ASP.NET 4 leverages new resource-monitoring functionality introduced by the CLR. To enable this functionality, you can add the following XML configuration snippet to the aspnet.config
<?xml version="1.0" encoding="UTF-8" ?>
When the appDomainResourceMonitoring feature has been enabled, two new performance counters are available in the "ASP.NET Applications" performance category: % Managed Processor Time
and Managed Memory Used. Both of these performance counters use the new CLR application-domain resource management feature to track estimated CPU time and managed memory utilization of individual ASP.NET applications. As a result, with ASP.NET 4, administrators
now have a more granular view into the resource consumption of individual applications running in a single worker process.
You can create an application that targets a specific version of the .NET Framework. In ASP.NET 4, a new attribute in the compilation element of the Web.config file lets you target the
.NET Framework 4 and later. If you explicitly target the .NET Framework 4, and if you include optional elements in the Web.config file such as the entries for system.codedom, these elements must be correct for the .NET Framework 4. (If you do not explicitly
target the .NET Framework 4, the target framework is inferred from the lack of an entry in the Web.config file.)
The following example shows the use of the targetFramework attribute in the compilation element of the Web.config file.
When you create a new website or project, a Scripts folder containing the following 3 files is created:
Include the unminified version of jQuery while developing an application. Include the minified version of jQuery for production applications.
In the past, if you used the ASP.NET ScriptManger then you were required to load the entire monolithic ASP.NET Ajax Library. By taking advantage of the new ScriptManager.AjaxFrameworkMode
property, you can control exactly which components of the ASP.NET Ajax Library are loaded and load only the components of the ASP.NET Ajax Library that you need.
The ScriptManager.AjaxFrameworkMode property can be set to the following values:
For example, if you set the AjaxFrameworkMode property to the value Explicit then you can specify the particular ASP.NET Ajax component scripts that you need:
<asp:ScriptManager ID="sm1" AjaxFrameworkMode="Explicit" runat="server">
<asp:ScriptReference Name="MicrosoftAjaxCore.js" />
<asp:ScriptReference Name="MicrosoftAjaxComponentModel.js" />
<asp:ScriptReference Name="MicrosoftAjaxSerialization.js" />
<asp:ScriptReference Name="MicrosoftAjaxNetwork.js" />
ASP.NET 4 adds two properties to the Page class, MetaKeywords and MetaDescription. These two properties represent corresponding meta tags in your page, as shown in the following example:
<head id="Head1" runat="server">
<meta name="keywords" content="These, are, my, keywords" />
<meta name="description" content="This is the description of my page" />
These two properties work the same way that the page’s Title property does.
The ViewStateMode property takes an enumeration that has three values: Enabled, Disabled, and Inherit. Enabled enables view state for that control and for any child controls that are
set to Inherit or that have nothing set. Disabled disables view state, and Inherit specifies that the control uses the ViewStateMode setting from the parent control.
ASP.NET determines the capabilities of the browser that a user is using to browse your site by using a feature called browser capabilities. Browser capabilities are represented by the
use the HttpBrowserCapabilities object to determine whether the request originated from a mobile device.
The id attribute in HTML that is rendered for Web server controls is generated based on the ClientID property of the control. Until ASP.NET 4, the algorithm for generating the id attribute
from the ClientID property has been to concatenate the naming container (if any) with the ID, and in the case of repeated controls (as in data controls), to add a prefix and a sequential number. While this has always guaranteed that the IDs of controls in
the page are unique, the algorithm has resulted in control IDs that were not predictable, and were therefore difficult to reference in client script.
The new ClientIDMode property lets you specify more precisely how the client ID is generated for controls. You can set the ClientIDMode property for any control, including for the page.
Possible settings are the following:
In some scenarios, such as when you are using master pages, controls can end up with IDs like those in the following rendered HTML:
This ID is guaranteed to be unique in the page, but is unnecessarily long for most purposes.The easiest way to reduce the length of the rendered ID is by setting the ClientIDMode property
as shown in the following example:
<tc:NamingPanel runat="server" ID="NamingPanel1" ClientIDMode="Predictable">
<asp:TextBox ID="TextBox1" runat="server" Text="Hello!"></asp:TextBox>
.NET Framework 4 release includes following feature of chart.
The ListView control has been made easier to use in ASP.NET 4. The earlier version of the control required that you specify a layout template that contained a server control with a known
ID. The following markup shows a typical example of how to use the ListView control in ASP.NET 3.5.
<asp:ListView ID="ListView1" runat="server">
<asp:PlaceHolder ID="ItemPlaceHolder" runat="server"></asp:PlaceHolder>
In ASP.NET 4, the ListView control does not require a layout template. The markup shown in the previous example can be replaced with the following markup:
In ASP.NET 3.5, you can specify layout for the CheckBoxList and RadioButtonList using the following two settings:
In ASP.NET 4, the CheckBoxList and RadioButtonList controls support the following new values for the RepeatLayout property:
ASP.NET uses both encryption and hashing algorithms to help secure data such as forms authentication cookies and view state. By default, ASP.NET 4 now uses the HMACSHA256 algorithm for
hash operations on cookies and view state. Earlier versions of ASP.NET used the older HMACSHA1 algorithm.
Jun 03, 2011 06:27 AM|Shakti Singh Tanwar|LINK
Below is a complete thread