BANGALORE, INDIA: ASP.NET has been evolving with each new version along with a number of out-of-band releases such as the Ajax Control Toolkit, ASP.NET MVC and Dynamic Data.
ASP.NET 4.0 will see a consolidation of all of these technologies under a common umbrella along with new enhancements to each of them. However, the core ASP.NET stack too gets some new features. The one that we'll delve into this month is a new control called QueryExtender.
How it helps One of the most common tasks that developers do on Web pages is connect to data and display them on the page. They also give ways for the user to filter it based on different criteria. Normally this is done by writing a dynamic SQL query that changes depending on the filter parameters being sent. For each new parameter, the developer has to create a new set of steps to parse and add the filter to the SQL query.
Creating a filter page To work with the new ASP.NET 4.0 you need to install Visual Studio 2010 Beta 1. This also installs the .NET 4.0 Beta 1. Once installed, fire up VS 2010 and create a new ASP.NET web site. Connect to your database using LINQ or Entity Framework and add tables you wish to query to your project. Once that is done, open up Web.config and add the following line to it in the section:
Note: This needs to be done only for the current beta. For later versions, it will be done automatically.
Now you are ready to start using the QueryExtender control. First off, create a normal ASPX page that uses the LinqDataSource or the EntityDataSource control to connect to your respective data model. Attach a GridView to display results and test it out without filters.
Get most out of your technology infrastructure investments with Dell
About CIOL | Media Kit | Site Map | Contact Us | Help | Write to us | Jobs@CyberMedia | Privacy Policy
Copyright © CyberMedia India Online Ltd. All rights reserved. Usage of content from web site is subject to Terms and Conditions.