Saturday, December 13, 2008

Using dropdownlist value in filterexpression of GridView.

Why AJAX?
Simply put it as if the user does not want to see a flicker on the screen on every postback and needs a winform like experience then making AJAX enabled website is the solution.
What is required to make a AJAX enabled web site?
Every ASPX page will have one and only one instance of script manager control. UpdatePanel control can be added as many are needed. Each server side control should be placed inside the contenttemplate tag of the UpdatePanel control. Thats all it is to make a AJAX enabled web site.
Sample Project:
Requirement: In SQL Server 2005, there is a users table.Using a ASPX web page this table new data needs to be inserted and updated.This page should be AJAX enabled.
Approach:
1.Quickly create a AJAX enabled web site in VS 2005.
2.Add a MasterPage in the project.
3.Add content page for the MasterPage.
4.Create stylesheet and add the stylesheet reference in the head tag of the

MasterPage.
What is a MasterPage?
A MasterPage is a central location where all the common functionality\features can be addressed and all the content pages will inherit from this Masterpage. This will ensure consistent looknfeel across the webapplication.

5.Create a objectdatasource for the gridview control. Add the FilterExpression property and set the value as "USERNAME Like '{0}%'" and add the . thats it.

0 comments:

Post a Comment