New Features Available in asp.net 4.0

No.of Views3004
Bookmarked0 times
Downloads 
Votes1
By  Kirti.M.Darji   On  18 Oct 2010 01:10:37
Tag : ASP.NET , ASP.NET 4.0 Forms
This article explain about what is new features available in asp.net 4.0
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

Today I am giving you introduction of  what’s new in asp.net 4.0.I hope it will help you

 
Setting Meta tag with Page
 
Asp.net 4.o added two new property like MetaKeyWords and MetaDescription. This property represents corresponding Meta tag in your Page
<head id="Head1" runat="server">
  <title>My Page Title</title>
  <meta name="keywords" content="Asp.net,Net,MVC,new' />
  <meta name="description" content="My asp.net 4.o new feature article" />
</head>
 
Content of description metatag are use for search listing preview for google.
 
ViewStateMode Property (for Enable view state for individual control)
 
By default view state is enable for page, with the result each control of page are potentially store view state data in page so page size is increase that’s why performance is degrade. In earlier virsion developer can do that thing to disable view state but he want to disable for all control. Now in asp.net 4.0 new viewstatemode property introduce which take following enumerated data type like Enable, Disable, Inherit.
 
For disable viewstatemode for page set viewstatemode property is disabling then whatever control you need viewstatemode enable this property for that control.


See following example

See above example ViewStateMode is Desable so for all control


CHANGES TO BROWSER CAPABILITIES


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 HttpBrowserCapabilitiesobject (exposed by the Request.Browser property). For example, you can use the HttpBrowserCapabilities object to determine whether the type and version of the current browser supports a particular version of JavaScript. Or, you can use the HttpBrowserCapabilities object to determine whether the request originated from a mobile device.
The HttpBrowserCapabilities object is driven by a set of browser definition files. These files contain information about the capabilities of particular browsers. In ASP.NET 4, these browser definition files have been updated to contain information about recently introduced browsers and devices such as Google Chrome, Research in Motion BlackBerry smartphones, and Apple iPhone.

 
 

ROUTING IN ASP.NET 4

Asp.net add built in support for using routing in web farm.Routing is nothing it just configure URL does not map with physical URll, you can use routing for display URl in meaningful way. For Example you want to display article for cshap category 
 
By routing you can configure Application can accept below URL to render same information above URL
 
 
 
 

SETTING CLIENT IDS

 
Client ID I already explain in my previous article
 

ASP.NET CHART CONTROL

The ASP.NET Chart control expands the data-visualization offerings in the .NET Framework. Using the Chart control, you can create ASP.NET pages that have intuitive and visually compelling charts for complex statistical or financial analysis. The ASP.NET Chart control was introduced as an add-on to the .NET Framework version 3.5 SP1 release and is part of the .NET Framework 4 release.


THE ABILITY TO PERSIST SELECTED ROWS IN DATA CONTROLS

Gridview and listview control eable user to select row.In previous version of asp.net row selection is based on row index on page. For example if you select page1 item no 3 and move to page 2 then on page 2 item no 3 is selected, so it is not desirable.now in asp.net 4.0 support Persisted Selection, a new feature in asp.net 4.0 using PersistedSelection property of grideview or listview if property is true then if you go to page 2 then no item is selected if you go back to page 1 then item no 3 is selected.
<asp:GridView id="gdEmployee" runat="server" PersistedSelection="true"></asp:GridView>
 
The FormView control is enhanced to make it easier to style the content of the control with CSS. In previous versions of ASP.NET, the FormViewcontrol rendered it contents using an item template. This made styling more difficult in the markup because unexpected table row and table cell tags were rendered by the control. Now in asp net 4.o  have RenderTable property which can set true or false if we set false then control are not rendered as table and row html format so it is easier to apply css style on content of control.
<asp:FormView ID="FrvEmployee" runat="server" RenderTable="false">
 
ListView
 
In ASP.NET 4, the ListView control does not require a layout template.
<asp:ListView ID="LvEmployee" runat="server">
    <ItemTemplate>
        <% Eval("LastName")%>
    </ItemTemplate>
</asp:ListView>
 

CHECKBOXLIST AND RADIOBUTTONLIST CONTROL ENHANCEMENTS

In ASP.NET 3.5, you can specify layout for the CheckBoxList andRadioButtonList using the following two settings:

  • Flow. The control renders span elements to contain its content.
  • Table. The control renders a table element to contain its content.

In ASP.NET 4, the CheckBoxList and RadioButtonList controls support the following new values for the RepeatLayout property:

  • OrderedList – The content is rendered as li elements within anol element.
  • UnorderedList – The content is rendered as li elements within aul element.

MENU CONTROL IMPROVEMENTS

Before ASP.NET 4, the Menu control rendered a series of HTML tables. This made it more difficult to apply CSS styles outside of setting inline properties and was also not compliant with accessibility standards.
In ASP.NET 4, the control now renders HTML using semantic markup that consists of an unordered list and list elements. The following example shows markup in an ASP.NET page for the Menu control.

<asp:Menu ID="MainMenu" runat="server"> 
  <Items> <asp:MenuItem Text="Home" Value="Home" /> 
  </Items> 

</asp:Menu> 

When the page renders, the control produces the following HTML (the onclick code has been omitted for clarity):

 

<div id="Menu1"> 
  <ul> 
    <li><a href="#" onclick="...">Home</a></li> 
 </ul> 

</div> 
<script type="text/javascript"> 
  new Sys.WebForms.Menu('Menu1'); 
</script>

 

WIZARD AND CREATEUSERWIZARD CONTROLS

ASP.NET 4, you can create a LayoutTemplate template and insertPlaceHolder controls (using reserved names) to specify how you want the Wizard control to render. The following example shows this:
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" ActiveStepIndex="1"> 
  <LayoutTemplate> 
    <asp:PlaceHolder ID="headerPlaceholder" runat="server" /> 
    <asp:PlaceHolder ID="sideBarPlaceholder" runat="server" /> 
    <asp:PlaceHolder id="wizardStepPlaceholder" runat="server" /> 
    <asp:PlaceHolder id="navigationPlaceholder" runat="server" /> 
  </LayoutTemplate> 
  <HeaderTemplate> 
    Header 
  </HeaderTemplate> 
  <WizardSteps> 
    <asp:CreateUserWizardStep runat="server"> 
      <ContentTemplate> 
      </ContentTemplate> 
    </asp:CreateUserWizardStep> 
    <asp:CompleteWizardStep runat="server"> 
      <ContentTemplate> 
      </ContentTemplate> 
    </asp:CreateUserWizardStep> 
  </WizardSteps> 

</asp:CreateUserWizard>
 

Reference:


so guys we meet in few day with new topic.thank for reading.
 
Sign Up to vote for this article
 
About Author
 
Kirti.M.Darji
Occupation-Software Engineer
Company-Maven-Infosoft Pvt.Ltd
Member Type-Expert
Location-Not Provided
Joined date-03 Jun 2009
Home Page-
Blog Page-http://kirtimdarji.blogspot.com/
I am Kirti M. Darji Senior Software Developer Having 3.5 Years Experience In Microsoft .Net(c#) Technologies.
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top
</