Update : ASP.NET 4.0 – In Depth Session – Download Video and PPT

Today I have given an Online session on “ASP.NET 4.0 – In Depth” with Abhishek in a community event organized by DotNetFunda.Com. Thanks to all the attendees. As we were running out of time, we will continue the same in a different session on rest of the topic.  All the nominated users will get an email for next session details.

Things that we have covered already :

  1. Basic Introduction of ASP.NET 4.0 Features
  2. Visual Studio 2010 Enhancement Session for ASP.NET 4.0 (With Demo)
  3. Server Control Enhancements (With Demo)
  4. Search Engine Optimization (With Demo)

Whatever we have covered till now, ready to download

ASP.NET 4.0 In-Depth Session videos, PPT and source code

We have lots of things to cover and probably we will fix a time later in the up coming weekends and update you the same.

Below topics we will cover in out next sessions

   1. State Management  improvement in ASP.NET 4.0  ( With Demo)

   2. Deployment in ASP.NET 4.0 ( with Demo )

   3. Client Side improvement ( With Demo )

   4. Dynamic Data ( With Demo)

Apart from those topic I will discuss few tips and tricks of ASP.NET 4.0

We will be update soon with our next session date and time. Thanks again for joining.

Regards,

Abhijit

.NET Community Session : ASP.NET 4.0 In-Depth

I  will be speaking in a .NET Community session  organized by http://dotnetfunda.com on ASP.NET 4.0 .  Below is the more details about the session

ASP.NET 4.0 introduces number of features that improve the core ASP.NET functionality and many changes that allow developers to have a strong controls over the application. These enhanced features makes ASP.NET 4.0 more effective for the web developer than the already existing versions of ASP.NET.

The agenda of this session :

  • What’s New in ASP.NET 4.0
  • Improvement in Visual Studio 2010 for web development
  • Empty Website project and Cleaner Web.Config
  • MetaKeyword and MetaDescription enhancements
  • Controlling ViewState mechanism 
  • Controlling ClientID generation for asp.net controls
  • CompressionEnabled Session
  • CSS Improvements and CSS Friendly Menu Control
  • ListView rendering mechanism, Enhancement in Listview control
  • Enhancement in RadioButtonList and CheckBoxList
  • SEO Friendly URL (Web Form Routing)
  • Permanent Redirection mechanism
  • Improvements in Code Expressions
  • Overview of Dynamic data
  • Caching mechanism (Output Caching, Object caching etc.)
  • ASP.NET Applications / Database deployment.
  • Q & A
  • Summary

Speakers:  Abhijit Jana & Abhishek Sur

Scheduled Date: 19-Sep-2010 (Sunday )

Scheduled Time: 2.00 PM to 4.30 PM

Live meeting URL:  https://www.livemeeting.com/cc/mvp/

Meeting ID:  Will be send from DotNetFunda.Com upon registration

Is Paid?: No, It’s FREE Session

Is Registration required ? Yes . Please register here http://bit.ly/d6aVYM .

Disclaimer : https://abhijitjana.net/disclaimer/

How to sort ASP.NET DropDownList based on DataValueField or DataTextField using LINQ?

Sorting ASP.NET Dropdown list is very common requirement for any of the web application development.  To Implement this features sometimes developers used to iterate through each and every item and create a sorted list of element then reassign the same source to dropdownlist or sort the element at source itself. But this thing can be done easily using LINQ. In this post I am going describe how you can sort a ASP.NET DropDownList based on either of DataTextField or DataValueField using LINQ and list of KeyValuePair elements as DataSource.

To start with the application, let’s consider you have following List of employee data as datasource of the DropDownList.

 /// <summary>
 /// Create List Of Employee
 /// </summary>
 List<KeyValuePair<int, string>> employees = new List<KeyValuePair<int, string>>
        {        new KeyValuePair<int,string>(1,"Abhijit"),
                  new KeyValuePair<int,string>(2,"Rahul"),
                  new KeyValuePair<int,string>(3,"Kunal"),
                  new KeyValuePair<int,string>(4,"Atul"),
                 new KeyValuePair<int,string>(5,"Abhishek"),
        };
 

In the employee list collection, you have added KeyValuePair for each element, where Key is employee ID and Value is the employee name.  The most interesting part of using KeyValuePair is you can bind either of Key or Value with the DropDownList as per your requirement

Now let’s bind the DropDownList with the DataSource

How to pass multiple values using GridView HyperLinkField ?

While working with GridView in ASP.NET, most of the time we used HyperlinkField column to navigate from one page to  different page with some value as argument.  In this blog post I have explained how can we pass multiple parameter with HyperLinkField in GridView.

To implement this features you need to know about  DataNavigationUrlField and  DataNavigateUrlFormatString properties of HyperLinkField. Let’s assume that you have a gridview as given below and you have already bind the datasource from code behind.

 <asp:gridview id="GrdEmp">
<columns runat="server" autogeneratecolumns="False" cellpadding="4">
<asp:boundfield datafield="ID" headertext="ID" />
<asp:boundfield datafield="Name" headertext="Name" />
<asp:boundfield datafield="ParentID" headertext="Base ID" />
</columns>
</asp:gridview>

Let’s first consider the case of passing single parameter. First thing that you need to do is, add a GridView “HyperLinkField “ column. After that you need to set the DataNavigationUrlField  and DataNavigateUrlFormatString properties for the same . In DataNavigationUrlField  you have to mention the name of the DataField which you want to bind as querystring. In DataNavigateUrlFormatString  you have to give the formatted URL String for the Navigation. The concept is same here as like FormatString the only difference is the data is coming from DataNavigationUrlField .

Unable to Start Web Site on IIS – “Process can not access the file because It’s being used by another process”. How to resolve ?

I was trying to run one of my local IIS hosted site I got page not found error. I was quite surprised to see that error because the site was up and running few hours back. I opened the IIS and found that my Site Application was in stopped mode. I started the web application and got the error message displayed below

Problem : Error message “Process can not access the file because It’s being used by anther process”  while starting the web application from IIS.

Investigation and Resolution:  Earlier my web site was running on the default IIS port ( Port 80 ).  From the error message it’s clear that port 80 is being used by some other process or some one is blocking it.

“CompressionEnabled” Session in ASP.NET 4.0

Session is the most important state management mechanism for a web application. In ASP.NET we are having two type of state management

1. In Process

2. Out Process

In process” is the by default session storage mode for ASP.NET Web application. When it comes under Out Process we can use either of state server or SQL Server to persist our session data.

Here I am going to describe one new features added in ASP.NET 4.0 realted with Session. If you want to know about when to use session, what session mode to use, how to configure the session storage please read one of my article “Exploring Session in ASP.NET” published at CodeProject.

In case of In Process, session data stored in In memory of worker process. But when we are talking about “OutProc” session mode, we need to ensure that session data should be “Serialized” first  . So, when we are moving session data from Web Server to Out Process Server ( State Server or SQL Server ) it can be a performance overhead based on the size of data that we are stroing in Session.

ASP.NET 4.0 comes us with a new option for compressing the Session data with Out Process Session mode. To enabling this functionality we need to add “compressionEnabled=”true” attribute with the SessionMode in web.config . Web.config entry would be look like below,

<sessionState mode="SQLServer" sqlConnectionString="Integrated Security=SSPI; data source=.;" <em>compressionEnabled="true" </em>allowCustomSqlDatabase="true">

This will compress / Decompress the session data during serialization / deserialzation of session data. ASP.NET 4.0 used System.IO.Compression.GZStream class to compress the session mode. One more important things to remember that use of compression mode is useful when we are storing large number of data in session because for every request it will going to use Gzip Compression/ Decompression going to be used to access the session variable.

Hope this will helps you !

Shout it

CSS Friendly Menu Control in ASP.NET 4.0


It is very much easier to apply CSS when we have ul,li elements as the HTML content. If we look into ASP.NET Menu Control till Version 3.5, its render as Table-TR-TD Tag. Though Table/Tr/Td is quite useful to display tabular data but sometime  creates  a big problem when we need to do more work with CSS. To overcome this problem we generally used CSS Friendly adapter to render the ASP.NET Control in ul/li mode.

ASP.NET 4.0 makes the things easier for web developer by providing “RenderingMode” properties. Here we can specify RenderMode of a ASP.NET Menu control. Which define the what will be the HTML Render Content Type. Bydefault mode is “List” which means control will be render as ul/li

As per the above diagram we can see that there are three mode available. We can use any one of them as per the requirement.

ViewState Control in ASP.NET 4.0


View State is one of the most important and useful client side state management mechanisms. It can store the page value at the time of post back (Sending and Receiving information from Server) of your page. ASP.NET pages provide the View State property as a built-in structure for automatically storing values between multiple requests for the same page.

we generally used “EnableViewState” Properties for both Page Level and Server Control Level to maintain the view state. Till ASP.NET 3.5 Version, Page Level view state control treat as highest priorities. Which means If we set EnableViewState= “False” in page level that will automatically derived by all the server side control. In that case if we set “EnableViewState=”True”” for any server side control will treat as false, as we have defined them “False” in Page Level.Here is one complete article on ASP.NET 2.0/3.5 View State , which may helpful for you

Now, let’s have a look into the changes in ViewState Control in ASP.NET 4.0. There is a massive change in View State Control in ASP.NET 4.0 which is very much helpful for developer also. Asp.net 4.0 added a new property to Page object and server controls called ViewStateMode.