Learning Curve…

Posts Tagged ‘ASP.NET

 

ASP.NET 4.0 supports built in support for URL Routing. This can make site more user friendly and site content more discoverable by search engines. It is also easy to remember and while bookmarking.

Following example shows URL without using Routing mechanism of ASP.NET 4.0.

http://website/products.aspx?categoryid=12

After using Routing mechanism of ASP.NET 4.0, above URL becomes as follow.

http://website/products/software

For mapping above URL to the list of products based on category, we need to map our route using new method MapPageRoute of class Route as shown in following examples.
Application_Start(object sender, EventArgs e)   {
     RouteTable.Routes.MapPageRoute(“ProductsRoute”,
         “product/{prodId}”, “~/products.aspx”);
}

 

Windows Workflow Foundation gives developers a declarative way to create workflows by using XAML.  These markup files are Stored with XOML (Extensible Object Markup Language) extension.  Markup file can also have code behind. The whole concept of having code behind for XOML file is to separate the presentation from logic files.

One of the best thing with Markup is we can change the sequence just by changing the XOML file we do not need to compile the whole application again.So using XOML we can serialize workflows.

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:
AutoID
This is equivalent to the algorithm for generating ClientID property values that was used in earlier versions of ASP.NET.

Static
This specifies that the ClientID value will be the same as the ID without concatenating the IDs of parent naming containers. This can be useful in Web user controls. Because a Web user control can be located on different pages and in different container controls, it can be difficult to write client script for controls that use the AutoID algorithm because you cannot predict what the ID values will be.

Predictable
This option is primarily for use in data controls that use repeating templates. It concatenates the ID properties of the control’s naming containers, but generated ClientID values do not contain strings like “ctlxxx”. This setting works in conjunction with the ClientIDRowSuffix property of the control. You set the ClientIDRowSuffix property to the name of a data field, and the value of that field is used as the suffix for the generated ClientID value. Typically you would use the primary key of a data record as the ClientIDRowSuffix value.

Inherit
This setting is the default behavior for controls; it specifies that a control’s ID generation is the same as its parent.

ASP.Net 4.0 has many improvements from previous versions such as

  • Web.config File Refactoring
  • Extensible Output Caching
  • Auto-Start Web Applications
  • Permanently Redirecting a Page by introducing a new method RedirectPermanent()
  • Shrinking Session State to shrink session data
  • Extensible Request Validation to avoid cross-site scripting (XSS) attacks by adding custom request-validation logic.
  • Object Caching and Object Caching Extensibility by introducing a new assembly “System.Runtime.Caching.dll”

ASP.Net 4.0 also introduced many new features such as

  • jQuery Included with Web Forms and MVC: Built in JQuery support
  • Content Delivery Network Support: Enables you to easily add ASP.NET Ajax and jQuery scripts to your Web applications. We can refence JQuery script over http like <script src=”http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js&#8221; >
  • New Meta tags under HTML Head tag
  • Enabling View State for Individual Controls
  • Extended Browser Capabilities
  • ASP.NET Chart Control to create visually compelling charts for complex statistical or financial analysis
  • New Field Templates for URLs and E-mail Addresses

ASP.Net 4.0 introduced a new URL redirection method RedirectPermanent() which avoids round trips.
You can implement this as shown below:

RedirectPermanent(“/newpath/newpage.aspx”);

In ASP.NET 4 FormView and on a few of the Login controls having RenderOuterTable property . When you set this property to True (it defaults to False so you need to set it explicitly) the control doesn’t generate a wrapping HTML <table> element. This in turn results in less code and cleaner HTML.


Author

Learning days (Calendar)

June 2017
M T W T F S S
« Jun    
 1234
567891011
12131415161718
19202122232425
2627282930  

Knowledge Bank (Archives)

I am on Twitter

Blog Stats

  • 498,681 hits

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 43 other followers

%d bloggers like this: