Difference between ASP.NET 3.5 and ASP.NET 4.0

Posted by imomins on April 3, 2013 at 3:55 AM

ASP.NET 3.5:

1. Whether Client data can be directly accessed ?
In ASP.NET 3.5, the data from the client side cannot be directly accessed. The client side data can only be accessed using script manager’s Page methods,
interface named ICallbackEventHandler or by using the component XMLHttpHandler.

2. Whether we can set MetaTags (Keywords,Description) in the Page Directive?
In ASP.NET 3.5, two meta tags can be used, one with name as keywords and other with name as description to record the keywords and description for SEO purpose.

<meta name="keywords" content="These, are, my, keywords" /> 
<meta name="description" content="This is the description of my page" /> 

3.Whether ViewState can be applied at the Control level ?
ASP.NET 3.5 EnableViewState property cannot be used to apply ViewState at the Control level.It is mainly used at the page level.Its default value is True and its acceptable values ae True and False.

4. How ASP.NET 3.5 identifies ClientID ?
In ASP.NET 3.5, ClientId property has to be used to find the dynamically generated client id.

5.Whether permanent redirection is possible or not ?
There is no RedirectPermanent() method available in ASP.NET 3.5.
Redirect method is less useful than the RedirectPermanent method. It will cause search engine results to be less current, and this can also impact performance because visitors will not be accessing the best URL. Redirect may be most useful for login pages or more complex situations. 

6. Output Caching Enhancement:
OutPut Cache in ASP.Net 3.5 has a limitation - generated content always has to be stored in memory, and on servers that are experiencing heavy traffic, the memory consumed by output caching can compete with memory demands from other portions of a Web application. 

7. QueryExtender Control for filtering the data returned by EntityDataSource and LinqDataSource controls:
There is no QueryExtender control available in ASP.NET 3.5 to filter the data returned by DataSource Controls( EntityDataSource and LinqDataSource).It has to explicitly use 'Where clause' in the data source.

ASP.NET 4.0:

1.Whether Client data can be directly accessed ?
In ASP.NET 4, the data from the client side can be directly accessed using client data view and client data context objects.

Following methods are available in ASP.NET 4.0 to access Client data directly,
1) Client data controls
2) Client templates
3) Client data context 

2. Whether we can set MetaTags (Keywords,Description) in the Page Directive?
The meta keywords and meta
description is really useful for SEO
optimization of the web page. In
ASP.NET 4, the keywords and
description can be included as part of page directive itself.

< %@ Page Language="C#" CodeFile="Default.aspx.cs" 
Description="description" %>

3.Whether ViewState can be applied at the Control level ?
In ASP.NET 4, ViewState mechanism is improved to set ViewState at the Contol level besides at the page level set by EnableViewState property in ASP.NET 3.5 .Its default value is Inherit and acceptable values are Enabled,Disabled and Inherit.

4. How ASP.NET 4.0 identifies ClientID ?
In ASP.NET 4, a property called
ClientIDMode is newly introduced to identify and record the ClientId easily.

ClientIDMode has following values.
AutoID – Same as ASP.NET 3.5
Static – There won’t be any separate clientid generated at run time
Predictable-These are used particularly in datacontrols. Format is like clientIDrowsuffix with the clientid vlaue
Inherit- This value specifies that a control’s ID generation is the same as its parent.

The default value of ClientIDMode for a page is Predictable. The default value of ClientIDMode for a control is Inherit. Because the default for controls is Inherit, the default generation mode is Predictable.

5. Whether permanent redirection is possible or not ?
ASP.Net 4.0 introduced a new URL redirection method RedirectPermanent() which avoids round trips.

We can implement this as shown below:


RedirectPermanent returns a 301 HTTP response—it redirects permanently to another location. Search engines such as Google and Bing will change their indexes to point to the new page directly. To call RedirectPermanent we will need to get the Response object from the HttpContext.
Then, we can call RedirectPermanent: if you pass false as the second parameter, we can perform further actions and avoid an exception.

6. Output Caching Enhancement:
ASP.NET 4 adds an extensibility point to output caching that enables you to configure one or more custom output-cache providers. Output-cache providers can use any storage mechanism to persist HTML content. This makes it possible to create custom output-cache providers for diverse persistence mechanisms, which can include local or remote disks, cloud storage, and distributed cache engines.

In order to know how to implement Custom Output Caching, please refer to the following URL,


7. QueryExtender Control for filtering the data returned by EntityDataSource and LinqDataSource controls:
QueryExtender Control is an add-on to the DataSource Controls: EntityDataSource and LinqDataSource. QueryExtender is used to filter the data returned by these controls. As the QueryExtender control relies on LINQ, the filter is applied on the database server before the data is sent to the page, which results in very efficient operations.

i.e., QueryExtender Control is intended to be used to create filters for data that is retrieved from a data source, without using an explicit Where clause in the data source. The control can be used to filter data in the markup of a Web page by using declarative syntax. 

<asp:LinqDataSource ID="dataSource" runat="server" TableName="Products"> 
<asp:QueryExtender TargetControlID="dataSource" runat="server">
<asp:SearchExpression DataFields="ProductName, Supplier.CompanyName" SearchType="StartsWith">
<asp:ControlParameter ControlID="TextBoxSearch" />

Categories: ASP.NET

Post a Comment


Oops, you forgot something.


The words you entered did not match the given text. Please try again.

You must be a member to comment on this page. Sign In or Register