<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Ahmed Moosa</title><link>http://weblogs.asp.net/ahmedmoosa/default.aspx</link><description>Nothing but ASP.Net </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Transact-SQL Course Presentation (Power Point File )</title><link>http://weblogs.asp.net/ahmedmoosa/archive/2011/10/19/transact-sql-course-presentation-power-point-file.aspx</link><pubDate>Wed, 19 Oct 2011 21:32:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7998821</guid><dc:creator>ahmed moosa</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/ahmedmoosa/rsscomments.aspx?PostID=7998821</wfw:commentRss><comments>http://weblogs.asp.net/ahmedmoosa/archive/2011/10/19/transact-sql-course-presentation-power-point-file.aspx#comments</comments><description>&lt;p style="font-weight: bold;"&gt;&lt;font size="3"&gt;&amp;nbsp;Hi , &lt;/font&gt;&lt;/p&gt;&lt;p style="font-weight: bold;"&gt;&lt;font size="3"&gt;&lt;span style="font-weight: normal;"&gt;I am working as .Net Trainer&amp;nbsp; , and Recently ,I was teaching a course in Transact-SQL , and I prepared a Power Point Presentation for this Course , I'd like to share this Presentation&amp;nbsp; with you.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style="font-weight: bold;"&gt;&lt;font size="3"&gt;&lt;span style="font-weight: normal;"&gt;this course talking about&amp;nbsp; : &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;ul style="font-family: times new roman,times;"&gt;&lt;li&gt;&lt;font size="3"&gt;What is SQL ?&lt;br&gt;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Data Types &lt;br&gt;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Constraints &lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Database Relationships&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Normalization&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;SQL Queries&amp;nbsp;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Transact- SQL Commands | DDL , DCL ,DML &lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Retrieving Data &lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Customizing Data&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Grouping Data&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;SQL Operators&amp;nbsp;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Joining Data&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Inserting , Updating and Deleting Data&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Working With Tables&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Working with Views&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Working With Constraints&amp;nbsp;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Generating Scripts&amp;nbsp; &lt;br&gt;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Transaction&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Working with Stored Procedures&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt; Working&amp;nbsp; with Functions&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size="3"&gt;Working With Triggers &lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br&gt;You Can Download this Presentation From &lt;a href="https://skydrive.live.com/view.aspx?cid=C5B18A9758861597&amp;amp;resid=C5B18A9758861597%21199" title="Click Here  :)" mce_href="https://skydrive.live.com/view.aspx?cid=C5B18A9758861597&amp;amp;resid=C5B18A9758861597%21199"&gt;HERE&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="font-weight: bold;"&gt;&lt;font size="3"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-weight: bold;"&gt;Hope you find something USEFUL&amp;nbsp; :)&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style="font-weight: bold;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="font-weight: bold;"&gt;&lt;font size="3"&gt;Ahmed &lt;/font&gt;&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7998821" width="1" height="1"&gt;</description><enclosure url="http://weblogs.asp.net/ahmedmoosa/attachment/7998821.ashx" length="1792984" type="application/x-zip-compressed" /><category domain="http://weblogs.asp.net/ahmedmoosa/archive/tags/Transact+SQL+Presentation/default.aspx">Transact SQL Presentation</category></item><item><title>Bind Gridview using Jquery</title><link>http://weblogs.asp.net/ahmedmoosa/archive/2010/10/30/bind-gridview-using-jquery.aspx</link><pubDate>Sat, 30 Oct 2010 17:10:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7634487</guid><dc:creator>ahmed moosa</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/ahmedmoosa/rsscomments.aspx?PostID=7634487</wfw:commentRss><comments>http://weblogs.asp.net/ahmedmoosa/archive/2010/10/30/bind-gridview-using-jquery.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;What about working with database using client-side? How can I bind Grid View using client-side? How can I retrieve specific row or column using client-side? OK.&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&lt;FONT color=#00ff00&gt;&lt;STRONG&gt;full Source Code :&lt;/STRONG&gt;&lt;/FONT&gt;&lt;A href="http://cid-c5b18a9758861597.office.live.com/self.aspx/ASP.Net/ASP.Net%20Samples/Bind%20GridView%20using%20Jquery.zip" mce_href="http://cid-c5b18a9758861597.office.live.com/self.aspx/ASP.Net/ASP.Net%20Samples/Bind%20GridView%20using%20Jquery.zip"&gt;&lt;FONT color=#00ff00&gt;&lt;STRONG&gt;Click Here&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;In fact there is no Data Source property existing in Jquery, but keep in mind that grid view render as Html Table control, and this is the trick! we will append values returned from database as rows but we faced a problem , since the grid view doesn't has a DataSource or DataSourceID property we can't get it in Html , in other words if grid view doesn't have records [data] , it will not be rendered , therefore we can't find it in html source when page loaded. So we need to show empty grid view &amp;nbsp;to get it using Jquery selector .&lt;/P&gt;
&lt;P dir=ltr&gt;another&amp;nbsp;problem we have is how can we retrieve the data? What is the return type?&lt;/P&gt;
&lt;P dir=ltr&gt;Actually jquery can't understand DataTable Object, DataSet or even DataReader .but already understand what array is ?,OK we get now that we will return an array but which data type "string , Integer , ......"?.&amp;nbsp;well We did it! Let us start coding.&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;First step :&lt;/STRONG&gt; Creating Data base which will be our data source ,we do it using building the following data table : &lt;/P&gt;
&lt;P dir=ltr&gt;Datastore.cs&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT size=1 face=verdana,geneva&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&lt;FONT size=1 face=verdana,geneva&gt; System;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; System.Data;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;class&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataStore&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; DataStore()&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 face=Consolas&gt;&lt;FONT color=#008000 face=Consolas&gt;&lt;FONT color=#008000 face=Consolas&gt;&amp;nbsp; &amp;nbsp; //&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 face=Consolas&gt;&lt;FONT color=#008000 face=Consolas&gt;&lt;FONT color=#008000 face=Consolas&gt;&amp;nbsp;&amp;nbsp; // TODO: Add constructor logic here&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 face=Consolas&gt;&lt;FONT color=#008000 face=Consolas&gt;&lt;FONT color=#008000 face=Consolas&gt;&amp;nbsp; //&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&amp;nbsp; }&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;static&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataTable&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; GetDataTable()&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&amp;nbsp;&amp;nbsp; DataTable&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; dt = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataTable&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"Names"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;);&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&amp;nbsp;&amp;nbsp; DataColumn&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; dc1 = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataColumn&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"Name"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;);&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&amp;nbsp;&amp;nbsp; DataColumn&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; dc2 = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataColumn&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"Age"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;);&lt;BR&gt;&amp;nbsp; &amp;nbsp;dt.Columns.AddRange(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataColumn&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;[] { dc1, dc2 });&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&amp;nbsp;&amp;nbsp; DataRow&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; dr1 = dt.NewRow();&lt;BR&gt;&amp;nbsp;&amp;nbsp; dr1[0] = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"Ahmed"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp; dr1[1] = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"27"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&amp;nbsp;&amp;nbsp; DataRow&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; dr2 = dt.NewRow();&lt;BR&gt;&amp;nbsp; &amp;nbsp;dr2[0] = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"Peter"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;;&lt;BR&gt;&amp;nbsp; &amp;nbsp;dr2[1] = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"30"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&amp;nbsp; &amp;nbsp;DataRow&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; dr3 = dt.NewRow();&lt;BR&gt;&amp;nbsp; &amp;nbsp;dr3[0] = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"John"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;;&lt;BR&gt;&amp;nbsp; &amp;nbsp;dr3[1] = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"20"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&amp;nbsp; &amp;nbsp;DataRow&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; dr4 = dt.NewRow();&lt;BR&gt;&amp;nbsp;&amp;nbsp; dr4[0] = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"Ali"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp; dr4[1] = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"30"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp; dt.Rows.Add(dr1);&lt;BR&gt;&amp;nbsp;&amp;nbsp; dt.Rows.Add(dr2);&lt;BR&gt;&amp;nbsp; &amp;nbsp;dt.Rows.Add(dr3);&lt;BR&gt;&amp;nbsp; &amp;nbsp;dt.Rows.Add(dr4);&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=5 face=Consolas&gt;&lt;FONT size=5 face=Consolas&gt;&lt;FONT size=2&gt; dt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&amp;nbsp; }&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P dir=ltr&gt;&lt;B&gt;Next step: &lt;/B&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Creating Class file "Names" which will contain two properties (Data base columns) for "FirstName" and "Age". Like this : &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;Names.cs&lt;/B&gt;&lt;/P&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;
&lt;P&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;class&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;Names&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; Names()&lt;BR&gt;&amp;nbsp;{&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 face=Consolas&gt;&lt;FONT color=#008000 face=Consolas&gt;&lt;FONT color=#008000 face=Consolas&gt;&amp;nbsp;&amp;nbsp; //&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 face=Consolas&gt;&lt;FONT color=#008000 face=Consolas&gt;&lt;FONT color=#008000 face=Consolas&gt;&amp;nbsp;&amp;nbsp; // TODO: Add constructor logic here&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 face=Consolas&gt;&lt;FONT color=#008000 face=Consolas&gt;&lt;FONT color=#008000 face=Consolas&gt;&amp;nbsp; //&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&amp;nbsp;}&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; _firstName;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;private&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; _age;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; FirstName&lt;BR&gt;&amp;nbsp;{&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;&amp;nbsp; set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; { _firstName = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;value&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;; }&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp; &amp;nbsp;get&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; { &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; _firstName; }&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; Age&lt;BR&gt;&amp;nbsp;{&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;&amp;nbsp; set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; { _age = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;value&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;; }&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp; &amp;nbsp;get&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; { &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=5 face=Consolas&gt;&lt;FONT size=5 face=Consolas&gt;&lt;FONT size=2&gt; _age; &lt;/FONT&gt;&lt;FONT size=1&gt;}&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;Next Step: &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Creating default.aspx page which will display and call the data.&lt;/LI&gt;
&lt;LI&gt;Create GridView Control in your page :&lt;BR&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;div&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;center&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;br&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;asp&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;GridView&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;ID&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="NamesGridView"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;runat&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="server"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;ShowHeaderWhenEmpty&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="True"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;asp&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;GridView&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;br&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;/&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;center&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;div&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P dir=ltr&gt;Notice that we set ShowHeaderWhenEmpty property to true to display columns names when empty.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;In page load event we will write some code which will display the gridview even it empty :&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;protected&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; Page_Load(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;object&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; sender, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;EventArgs&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataTable&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; dt = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataTable&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;();&lt;BR&gt;&amp;nbsp;&amp;nbsp; dt.Columns.AddRange(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataColumn&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;[] { &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataColumn&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"Name"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;), &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataColumn&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;"Age"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=5 face=Consolas&gt;&lt;FONT size=5 face=Consolas&gt;&lt;FONT size=2&gt;) });&lt;BR&gt;&amp;nbsp;&amp;nbsp;NamesGridView.DataSource = dt;&lt;BR&gt;&amp;nbsp; NamesGridView.DataBind();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;}&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P dir=ltr&gt;Notice that we created two columns Names as "Name" and "Age" .Now you can run the page the GridView should be displayed (try it!). &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;In code behind we will create a method which will connect to datastore and retrieve the data values. As the following :&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;BR&gt;&lt;FONT size=5 face=Consolas&gt;&lt;FONT size=5 face=Consolas&gt;&lt;FONT size=1&gt;[&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af size=1 face=Consolas&gt;WebMethod&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&lt;FONT size=1&gt;]&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;static&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;Names&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&lt;FONT size=1&gt;[] GetNames()&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&amp;nbsp;&amp;nbsp;List&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;Names&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&amp;gt; list = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;List&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;Names&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&lt;FONT size=1&gt;&amp;gt;();&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&amp;nbsp; DataTable&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; dt = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataStore&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&lt;FONT size=1&gt;.GetDataTable();&lt;BR&gt;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;foreach&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;DataRow&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; row &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;in&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&lt;FONT size=1&gt; dt.Rows)&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=1&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;Names&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; _names = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;&lt;FONT color=#2b91af face=Consolas&gt;Names&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&lt;FONT size=1&gt;();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=1&gt;_names.FirstName = row[&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 size=1 face=Consolas&gt;"Name"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&lt;FONT size=1&gt;].ToString();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=1&gt;_names.Age = row[&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 face=Consolas&gt;&lt;FONT color=#a31515 size=1 face=Consolas&gt;"age"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&lt;FONT size=1&gt;].ToString();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=1&gt;list.Add(_names);&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=1&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff size=1 face=Consolas&gt;&amp;nbsp; return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=5 face=Consolas&gt;&lt;FONT size=5 face=Consolas&gt;&lt;FONT size=1&gt; list.ToArray();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Here we fill data values in the two properties (FirstName,Age) then we add it to List which accept Names Class Object as you saw above. And at the end we need to convert it to an array .&lt;/P&gt;
&lt;P dir=ltr&gt;Notice that the method decorated with [Web Method] attribute which will allow us to get this method using client side code , and the method need to be declared as public and static also to get reached &amp;nbsp;outside the Container class .&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;B&gt;Next Step : &lt;/B&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;- Calling Server side method that will get the data values and bind the gridview using Jquery like this : &lt;/LI&gt;&lt;/UL&gt;
&lt;P dir=ltr&gt;&lt;BR&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;script&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;type&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="text/javascript"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;src&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;script&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;script&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;type&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="text/javascript"&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp; function&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; BindGridView() {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $.ajax({&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;"POST"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;"Default.aspx/GetNames"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data: &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;"{}"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contentType: &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;"application/json"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataType: &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;"json"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; success: &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;function&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; (data) {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;var&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; i = 0; i &amp;lt; data.d.length; i++) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;"#NamesGridView"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;).append(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;"&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; + data.d[i].FirstName +&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;"&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; + data.d[i].Age + &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;"&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; })&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;script&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P dir=ltr&gt;We can retrieve one column like "FirstName" or "Age" only, in the above code we create a loop to go through result data and using index of array element to get current row ,it is working like a datareader or dataset, then you get specific value "data.d[n].Age".&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;now ,we can call this functon on body load Like this : &lt;BR&gt;&lt;BR&gt;&amp;lt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;body&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;onload&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="BindGridView();"&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;form&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;id&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="form1"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;runat&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="server"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;div&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;center&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;br&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;asp&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;GridView&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;ID&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="NamesGridView"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;runat&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="server"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;ShowHeaderWhenEmpty&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="True"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;asp&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;GridView&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;br&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;center&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;div&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;form&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;body&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=5 face=Consolas&gt;&lt;FONT size=5 face=Consolas&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P dir=ltr&gt;When we run this page it should Display GridView like this :&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&lt;A href="http://weblogs.asp.net/blogs/ahmedmoosa/gridviewimage.PNG" mce_href="http://weblogs.asp.net/blogs/ahmedmoosa/gridviewimage.PNG"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/ahmedmoosa/gridviewimage.PNG" mce_src="http://weblogs.asp.net/blogs/ahmedmoosa/gridviewimage.PNG"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;Happy programming &lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;Ahmed Moosa&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7634487" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/ahmedmoosa/archive/tags/ASP.Net/default.aspx">ASP.Net</category><category domain="http://weblogs.asp.net/ahmedmoosa/archive/tags/GridView/default.aspx">GridView</category><category domain="http://weblogs.asp.net/ahmedmoosa/archive/tags/Jquery/default.aspx">Jquery</category></item><item><title>Embedded Code and Inline Server Tags</title><link>http://weblogs.asp.net/ahmedmoosa/archive/2010/10/06/embedded-code-and-inline-server-tags.aspx</link><pubDate>Thu, 07 Oct 2010 06:31:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7624710</guid><dc:creator>ahmed moosa</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/ahmedmoosa/rsscomments.aspx?PostID=7624710</wfw:commentRss><comments>http://weblogs.asp.net/ahmedmoosa/archive/2010/10/06/embedded-code-and-inline-server-tags.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;&lt;FONT color=#009900 size=3&gt;&lt;STRONG&gt;Introductions&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Hi, this my first article here and I hope it will be&amp;nbsp; more useful , so we will talk about&amp;nbsp; something we need to use&amp;nbsp;every day in coding ,we&amp;nbsp;will talk about&amp;nbsp; "Embedded Code " using "In line Server Tags " . Briefly it used to write server side code somewhere where it not allowed directly . more developers use it in data binding controls .but you can use it in many Places Like (Java Script , CSS , ASPX ) , and you can use it with Routing ,ConnectionStrings , XMLQuery , AppSettings , Recourses Files or just writing server side code mixed with html.&amp;nbsp;&amp;nbsp;my be you&amp;nbsp;had seen it in the top of&amp;nbsp;.aspx&amp;nbsp;&amp;nbsp;page .OK ! Let us&amp;nbsp; begin .&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;A href="http://cid-c5b18a9758861597.office.live.com/self.aspx/My%20Bolgs/embedded%5E_Code.zip" mce_href="http://cid-c5b18a9758861597.office.live.com/self.aspx/My%20Bolgs/embedded%5E_Code.zip"&gt;&lt;FONT color=#0000ff&gt;&lt;STRONG&gt;Download sample Code from Here &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#00cc00&gt;&lt;STRONG&gt;What In line Server Code is ?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;inline server code enables&amp;nbsp;you to&amp;nbsp;embedded&amp;nbsp;server side code mixed with client&amp;nbsp;script like javascript&amp;nbsp;or mixed with&amp;nbsp;aspx or with&amp;nbsp;css as we mentioned before. &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#00cc00&gt;&lt;STRONG&gt;What Is In line Server Tags ? &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Look at this : &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ccff99"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color=#ffff00&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;these tags what we talk about. It&amp;nbsp;comes from&amp;nbsp;ASP classic style and it used in PHP and JSP too for the same reason "Writing Server Side Code ".&lt;/P&gt;
&lt;P dir=ltr&gt;Note: you must know that we can't use it in code behind (Page.aspx.cs ) .&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#00cc00&gt;&lt;STRONG&gt;inline Code and &amp;nbsp;Page Life cycle :&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;When the page call its Render Method after the PreRenderComplete Event completed the compiler will Execute this Code and embedded it into Render method&amp;nbsp;which accept&amp;nbsp;HtmlTextWriter&amp;nbsp; as a single parameter&amp;nbsp; like the following :&lt;/P&gt;
&lt;P dir=ltr&gt;protected override void Render(HtmlTextWriter writer)&lt;BR&gt;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; base.Render(writer);&lt;BR&gt;}&lt;/P&gt;
&lt;P dir=ltr&gt;Let us see the forms you may have seen:&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;&lt;FONT color=#00cc00&gt;&amp;nbsp;Page Directive &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Page Language="C#"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;&lt;FONT color=#00cc00&gt;Rendering Code&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt; Response.Write("Hello World!");&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;= SayHello("Ahmed")&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;: DateTime.Now.ToString()&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#00cc00&gt;&lt;STRONG&gt;Expression Syntax &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;$ ConnectionStrings:ConnStrFromWebConfig&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;$ AppSettings:ValueFromWebConfig&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;$ Resources:Resource, Arabic&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;$ RouteValue:year&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;$ YourExpressionPrefix : Any &amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#00cc00&gt;&lt;STRONG&gt;Data Binding&amp;nbsp; Syntax &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# Eval("Name")&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# Bind("Name")&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# XPath ("Name")&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;B&gt;&lt;FONT color=#00cc00&gt;Comment Server &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;-- &amp;lt;asp:Label runat="server" Text="Label"&amp;gt;&amp;lt;/asp:Label&amp;gt;--&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Let us do it in details : &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;B&gt;&lt;FONT color=#00cc00 size=3&gt;&lt;FONT color=#009900&gt;Directive&lt;/FONT&gt; &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;We use directive to specify settings used by page and user control Compiler&amp;nbsp;. we use it to say hi complier this file is ...... .each directive can have number of attributes as you need.&lt;/P&gt;
&lt;P dir=ltr&gt;each&amp;nbsp;directive start with @ . ASP.Net introduced number of Directive as following :&lt;BR&gt;&lt;FONT color=#3333cc&gt;&lt;FONT color=#000000&gt;&lt;BR&gt;&lt;/FONT&gt;@Page&lt;/FONT&gt; : used on .aspx files only&amp;nbsp;and you can use only one&amp;nbsp; directive&amp;nbsp;inside a file&amp;nbsp;.&amp;nbsp;&lt;BR&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&lt;BR&gt;&amp;lt;%&lt;/FONT&gt;@ Page Language="C#" &lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Page Language="C#" CodeFile="Default2.aspx.cs" Inherits="Default2"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Note that we are &amp;nbsp;using &lt;STRONG&gt;Codefile&lt;/STRONG&gt; to pass the file&amp;nbsp;name&amp;nbsp;of code behind and &lt;STRONG&gt;inherits&lt;/STRONG&gt; to pass class Name.&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000ff&gt;@Control &lt;/FONT&gt;: used only in .ascx files (user control)&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Control Language="C#" ClassName="WebUserControl"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000ff&gt;@Import&lt;/FONT&gt; :&amp;nbsp; used&amp;nbsp;for name space declaration and only when we write code&amp;nbsp;inside&amp;nbsp;script tags,I mean that if we use code behind we don't need it because we will use "Using Directive" (C#) or " Imports "&amp;nbsp;(VB.net)&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Import Namespace="System.Data"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000ff&gt;@Assembly&lt;/FONT&gt; : &amp;nbsp;used to Links an Assembly(.DLL or .CS and .VB ) to that page and user control .&lt;/P&gt;
&lt;P dir=ltr&gt;DLL files like this &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Assembly Name="CustomFile"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;(without .dll extension )&lt;/P&gt;
&lt;P dir=ltr&gt;Class files like this :&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Assembly src="Csharp.cs"&amp;nbsp;&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Assembly src="Csharp.vb"&amp;nbsp;&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Note: we are using &lt;STRONG&gt;Name&lt;/STRONG&gt; attribute with dll files and &lt;STRONG&gt;src&lt;/STRONG&gt; with class files.&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000ff&gt;@Register&lt;/FONT&gt; : used to register Controls (User Controls and Custom Server Controls) to page and user control.&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Register src="WebUserControl.ascx"&amp;nbsp;&amp;nbsp; tagname="WebUserControl" tagprefix="uc1"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;Note :we are using &lt;STRONG&gt;Name&lt;/STRONG&gt; attribute when using assembly and&amp;nbsp;using &lt;STRONG&gt;src&lt;/STRONG&gt; when user control.&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000ff&gt;@Implements&lt;/FONT&gt; : used when we want to implement an Interface . and this Directive &amp;nbsp;takes only one attribute "Interface" .&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Implements Interface="IWebParts"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000ff&gt;@Reference&lt;/FONT&gt; : used to indicate that the source file of the page or user control&amp;nbsp; should dynamically compiled and linked to&amp;nbsp;the current page .&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Reference Control ="~/WebUserControl.ascx"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Reference Page="~/Default2.aspx"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Reference VirtualPath ="anyfile.any"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000ff&gt;@OutPutCache :&lt;/FONT&gt; used when we need to put a page or user control in the cache.&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ OutputCache Duration ="900" VaryByParam ="none"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Note: both attributes ( Duration and VarybyParam ) are required .&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000ff&gt;@Master&lt;/FONT&gt; : used to decalre&amp;nbsp;page as Master page.&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Master Language="C#"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000ff&gt;@MasterType&lt;/FONT&gt; : used to reference Master Page when we need to access master page through &amp;nbsp;Master Property .&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ MasterType VirtualPath ="~/MasterPage.master"&amp;nbsp;&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000ff&gt;@PreviousPage&lt;/FONT&gt; : used when need to access previous&amp;nbsp;page through PreviousPage Property .&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ PreviousPageType VirtualPath ="~/Default4.aspx"&amp;nbsp;&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000cc&gt;@Application&lt;/FONT&gt; : used to declare the global application file .(global.asax)&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Application Language="C#"&amp;nbsp;&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000cc&gt;@WebService&lt;/FONT&gt; : used to declare the web service file .(.asmx)&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ WebService Language="C#" CodeBehind="~/App_Code/WebService.cs" Class="WebService"&amp;nbsp;&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000cc&gt;@WebHandler&lt;/FONT&gt;: used to declare the generic handler file (.ashx)&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ WebHandler Language="C#" Class="Handler"&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#0000cc&gt;@ServiceHost&lt;/FONT&gt; : used by WCF (Windows Communication Foundation) .&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ ServiceHost Language="C#" Debug="true" Service="Service" CodeBehind="~/App_Code/Service.cs" &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#009900 size=3&gt;&lt;STRONG&gt;Rendering Code&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Render code tags like Response.write Method. Here an example : using for Looping &lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%&lt;/FONT&gt; for(int i = 0 ; i &amp;lt;5; i++){&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt; %&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hello World ! &amp;lt;br /&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;&amp;nbsp; } &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;output the following :&lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Hello World ! &lt;/P&gt;
&lt;P dir=ltr&gt;Hello World ! &lt;/P&gt;
&lt;P dir=ltr&gt;Hello World ! &lt;/P&gt;
&lt;P dir=ltr&gt;Hello World ! &lt;/P&gt;
&lt;P dir=ltr&gt;Hello World !&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;you can use it to execute a method but this time we use " = " to get out of Response.write to an Expression and = &amp;nbsp;is used to resolve an expression and return its value to the block&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Page Language="C#"&amp;nbsp;&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;script runat="server"&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string message = "I Can Do it ";&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string SayHello(string name)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Hello&amp;nbsp; " + name;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;head runat="server"&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Test Page &amp;lt;/title&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;/head&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;body&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id="form1" runat="server"&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&lt;BR&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%&lt;/FONT&gt;= SayHello("Ahmed") &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt;&lt;BR&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=&lt;/FONT&gt;"Message variable = " + message &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;BR&gt;&amp;lt;/body&amp;gt;&lt;BR&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;it&amp;nbsp;will output string say "Hello Ahmed " and also gets&amp;nbsp;the value of message variable .&lt;/P&gt;
&lt;P dir=ltr&gt;Note : this code blocks render nothing (no html controls ) . try it&amp;nbsp;yourself&amp;nbsp;. browse this code in the browser and Right click to View source .&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;A href="http://weblogs.asp.net/scottgu/archive/2010/04/06/new-lt-gt-syntax-for-html-encoding-output-in-asp-net-4-and-asp-net-mvc-2.aspx" mce_href="http://weblogs.asp.net/scottgu/archive/2010/04/06/new-lt-gt-syntax-for-html-encoding-output-in-asp-net-4-and-asp-net-mvc-2.aspx"&gt;&lt;FONT color=#0000ff&gt;Html Encoding output in ASP.Net 4&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;It provides a concise way to automatically HTML encode content and then render it as output&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;nbsp; &amp;lt;%:&lt;/FONT&gt;DateTime.Now.ToString () &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;You can learn more &lt;A href="http://weblogs.asp.net/scottgu/archive/2010/04/06/new-lt-gt-syntax-for-html-encoding-output-in-asp-net-4-and-asp-net-mvc-2.aspx" mce_href="http://weblogs.asp.net/scottgu/archive/2010/04/06/new-lt-gt-syntax-for-html-encoding-output-in-asp-net-4-and-asp-net-mvc-2.aspx"&gt;here&lt;/A&gt; :&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;we can also use it to embedded Server Side code in Client Side Code (Java Script) &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;what about calling Server side Method from Client Side Method . Let us do it :&lt;/P&gt;
&lt;P dir=ltr&gt;take a look at this code &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;@ Page Language="C#"&amp;nbsp;&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&amp;lt;script runat="server"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string SayHello(string name)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Hello&amp;nbsp; " + name;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;head runat="server"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Test Page &amp;lt;/title&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script type="text/javascript" &amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function SayAny() {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(' &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;= SayHello("ahmed")&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt; %&amp;gt;&lt;/FONT&gt;');&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;BR&gt;&amp;lt;/head&amp;gt;&lt;BR&gt;&amp;lt;body&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id="form1" runat="server"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type="submit" onclick="SayAny()" value="Say Hello" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;BR&gt;&amp;lt;/body&amp;gt;&lt;BR&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;it do what you expect : showing alert message .&lt;BR&gt;&lt;BR&gt;Sometimes we have a problem when&amp;nbsp;passig&amp;nbsp;control id to client side code like this &lt;/P&gt;
&lt;P dir=ltr&gt;var txt = document.getElementById("TextBox1");&lt;/P&gt;
&lt;P dir=ltr&gt;and this happened when we work with container like master page or&amp;nbsp;when&amp;nbsp;we want to find&amp;nbsp;control inside Data contorls Like GridView&amp;nbsp;,DataList ,Repeater ,and so on. this happens because the control&amp;nbsp;has been changed to something like "container_ControlId". and to solve this issue we can use server side blocks like the&amp;nbsp;following :&lt;/P&gt;
&lt;P dir=ltr&gt;var txt = document.getElementById("&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;=TextBox1.ClientID &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt;");&lt;/P&gt;
&lt;P dir=ltr&gt;you can use alert message to display the value of this TextBox&amp;nbsp;like this : &lt;/P&gt;
&lt;P dir=ltr&gt;alert(txt.value);&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;B&gt;&lt;FONT color=#009900 size=3&gt;Expression Syntax :&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;Get Connection String Section :&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;$ ConnectionStrings:ConnStrFromWebConfig &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;after&amp;nbsp;we set connection strings in web.config file then we need to use data source controls&amp;nbsp;,Like the following :&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;Example &lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;asp:SqlDataSource ID="SqlDataSource2" &amp;nbsp;&amp;nbsp;runat="server"&amp;nbsp; ConnectionString="&amp;lt;%$ ConnectionStrings:ConnectionString %&amp;gt;" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; SelectCommand="SELECT * FROM [Categories]"&amp;gt;&lt;BR&gt;&amp;lt;/asp:SqlDataSource&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Notice: connectionstring is the name of connection string section inside Web.Config Like following : &lt;/P&gt;
&lt;P dir=ltr&gt;Web.config :&lt;BR&gt;&amp;lt;connectionStrings&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;lt;add name="ConnectionString" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NORTHWND.MDF;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Integrated Security=True;User Instance=True"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; providerName = "System.Data.SqlClient" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;/connectionStrings&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;Get AppSettings Section &lt;BR&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;$ AppSettings:ValueFromWebConfig &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;after we&amp;nbsp;set AppSettings section in web.config file you can call it using key name to return its value .&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Web.config &lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;&amp;lt;appSettings&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add key ="KeyName" value ="This Value Is Ahmed"/&amp;gt;&lt;BR&gt;&amp;lt;/appSettings&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;Default.aspx&lt;/STRONG&gt; &lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;asp:Label Text="&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;$ AppSettings :Keyname&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;" runat="server" /&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;Get a value from Global Resource File (.resx )&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;$ Resources:Resource, Arabic&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Let us take an example switching between two Language (Arabic and English ).&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create two files (Resource.resx , Resource.ar-eg.resx ) and put them in App_GlobalResources folder.&lt;/LI&gt;
&lt;LI&gt;Define a key with name "Greeting" in both resource files.&lt;/LI&gt;&lt;/UL&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Note&lt;/STRONG&gt; : the "greeting" key will have two different value for Arabic and English .&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create test page.aspx and drag a label control and drop down list control. so ,your aspx code will be like this : &lt;/LI&gt;&lt;/UL&gt;
&lt;P dir=ltr&gt;&amp;lt;div&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ListItem Value="ar-eg"&amp;gt;Arabic&amp;lt;/asp:ListItem&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ListItem Value="en-us"&amp;gt;English&amp;lt;/asp:ListItem&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:DropDownList&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Label ID="Label1" runat="server" Text="&amp;lt;%$ Resources:Resource, Greeting %&amp;gt;"&amp;gt; &amp;lt;/asp:Label&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;Note :&lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;- &lt;STRONG&gt;Resources&lt;/STRONG&gt; &amp;gt;&amp;gt; Say " I am working with resource files ".&lt;/P&gt;
&lt;P dir=ltr&gt;- &lt;STRONG&gt;Resource&lt;/STRONG&gt; &amp;gt;&amp;gt; say "I am the resource file name without extension".&lt;/P&gt;
&lt;P dir=ltr&gt;- &lt;STRONG&gt;Greeting&lt;/STRONG&gt; &amp;gt;&amp;gt; say " I am the Key which my value will be displayed"&lt;/P&gt;
&lt;P dir=ltr&gt;now&amp;nbsp;we have two values for&amp;nbsp;"Arabic" and "English" we can switch between them. what will happen if we select English or Arabic ? ok, we need some code to change Language and Current Culture .let us go to next step:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;We need to override IntializeCulture Method as following :&lt;/LI&gt;&lt;/UL&gt;
&lt;P dir=ltr&gt;protected override void InitializeCulture()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Request["DropDownlist1"] != null)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string lang = Request["DropDownlist1"];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(lang );&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.CreateSpecificCulture(lang );&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;
&lt;P dir=ltr&gt;Now you can select your Language from drop down list control and see that the related content will be displayed.&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;Routing &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;ASP.Net Routing is something about mapping URLs, Routing is available in ASP.Net web forms and ASP.Net MVC.Since .net framework 3.5. to use routing you need to create static method that take a parameter&amp;nbsp;of RouteCollection data type inside global.asax file, then call these method in Application_Start event .&lt;/P&gt;
&lt;P dir=ltr&gt;May you need more in Routing&amp;nbsp; so here you can take a look &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd329551.aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd329551.aspx"&gt;http://msdn.microsoft.com/en-us/library/dd329551.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Ok , what we want to say is we can use Expression Syntax to set URLs Like this : &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;$ RouteUrl:action=Edit , CategoryName=Cars&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;$ RouteValue:year &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;You need to understand what action and categoryName means? To do this refer to The above Link .&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;Exrpression Builder&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;$ YourExpressionPrefix : Any &amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;yes ,&amp;nbsp; you can create your Expression like mine : &lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT color=#0000ff size=5 face=Consolas&gt;&lt;FONT size=1&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;div&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;asp&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;Label&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;Text&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt;&amp;lt;%&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;$&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; myCode:DateTime.Now %&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;&lt;FONT color=#ff0000 face=Consolas&gt;runat&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;="server"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Consolas&gt;&lt;FONT face=Consolas&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;/&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;&lt;FONT color=#800000 face=Consolas&gt;div&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;FONT color=#0000ff face=Consolas&gt;&lt;BR&gt;to learn more about Expression Builder &lt;A href="http://weblogs.asp.net/infinitiesloop/archive/2006/08/09/The-CodeExpressionBuilder.aspx" mce_href="http://weblogs.asp.net/infinitiesloop/archive/2006/08/09/The-CodeExpressionBuilder.aspx"&gt;Click Here&lt;/A&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color=#00cc00&gt;Data Binding Syntax &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# Eval("Name") &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# Bind("Name")&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# XPath ("Name") &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;We use embedded code in Data binding to set or get or in Other words to read and write to a data source .we have Two methods for&amp;nbsp; working with Data base (Eval and Bind ) and one for working with XML (XPath that stand of xml path ) .so , what is the different between Eval and bind ? Eval method is One way that means it is for reading and Bind method is Two way that means it is for Reading and writing&amp;nbsp; .&lt;/P&gt;
&lt;P dir=ltr&gt;Example :&amp;nbsp; using eval method in grid view to display Images .&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Columns&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;asp:TemplateField&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ItemTemplate&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Image ID="Image2" runat="server" ImageUrl='&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# Eval("Path")&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;' Width="70" /&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ItemTemplate&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:TemplateField&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Columns&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:GridView&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;In the above example we use eval method to get path field from data base and pass It to ImageUrl Property.&lt;/P&gt;
&lt;P dir=ltr&gt;try to use bind method in editing data. &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;STRONG&gt;XPath method: &lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Use it when working with Xml, we can use it to select element or attribute and get its value and it comes in many forms Like this : &lt;/P&gt;
&lt;P dir=ltr&gt;Look at this file.xml. we use it to simplifies the following :&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;BR&gt;&amp;lt;Links&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Link&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;name&amp;gt;Microsoft&amp;lt;/name&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Site&amp;gt;http://www.microsoft.com&amp;lt;/Site&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Link&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;nbsp;&amp;lt;Link&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;name id="10" &amp;gt;Asp.net&amp;lt;/name&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;lt;Site&amp;gt;http://www.asp.net&amp;lt;/Site&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Link&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;Link&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;name id="20" &amp;gt;MSDN&amp;lt;/name&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Site&amp;gt;http://www.msdn.com&amp;lt;/Site&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/Link&amp;gt;&lt;BR&gt;&amp;lt;/Links&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# XPath ("Name") &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt; &lt;/P&gt;
&lt;P dir=ltr&gt;get the value of the Name element .&lt;/P&gt;
&lt;P dir=ltr&gt;output here will be as following : Microsot&amp;nbsp; ASP.Net&amp;nbsp; MSDN &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# XPath("name[@id]") &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt; &lt;/P&gt;
&lt;P dir=ltr&gt;Get the value of the name element which take an attribute &amp;nbsp;with name "Id"&lt;/P&gt;
&lt;P dir=ltr&gt;output here will be as following : ASP.Net&amp;nbsp; MSDN &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# XPath ("name[@id=\"10\"]") &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Get the value of name element which take an attribute with name id that its value equal 10 .&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;output here will be as following : ASP.Net&amp;nbsp; &lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# XPath("name/@id") &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Get the value of &amp;nbsp;Every &amp;nbsp;attribute which its name is 'id' that&amp;nbsp; was defined in "name" element .&lt;/P&gt;
&lt;P dir=ltr&gt;output here will be as following : 10&amp;nbsp; 20 &lt;/P&gt;
&lt;P dir=ltr&gt;Yes, it is give xml more funs .&lt;/P&gt;
&lt;P dir=ltr&gt;Note :&lt;/P&gt;
&lt;P dir=ltr&gt;When using your custom method as Binding Expression Remember to call Databind Method . this question I meet it in Asp.Net forums and that is my answer "call Databind method to that control "&lt;/P&gt;
&lt;P dir=ltr&gt;Example : Get Text&amp;nbsp; from the result of custom method .&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;div&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;asp:Button ID="SomethingBtn" Text="&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# ServerSideMethod()&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;" runat="server" /&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;So when we try to view it in browser the button wouldn't display any text . because we need to call Data bind method for that button Like this : &lt;/P&gt;
&lt;P dir=ltr&gt;protected void Page_Load(object sender, EventArgs e)&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Somethingbtn.DataBind();&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P dir=ltr&gt;And finally I want to say that you can use all or one of them Like this :&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# Eval("Id","~/default.aspx?id={0}")&amp;nbsp;&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# "Your Name Is :" + Eval("Name")&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;# SayHello( Eval("Name").ToString () )&lt;FONT style="BACKGROUND-COLOR: #ccff99" color=#ffff00&gt; &lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;And More ........... &lt;/P&gt;
&lt;P dir=ltr&gt;Last thing is Comment Server&amp;nbsp; &lt;/P&gt;
&lt;P dir=ltr&gt;We can use it to put&amp;nbsp; a comment where the comment is not allowed&amp;nbsp; .&lt;/P&gt;
&lt;P dir=ltr&gt;Example :&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;div&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/FONT&gt;-- &amp;lt;asp:Button ID="Button2" runat="server" Text="Button"&amp;nbsp; /&amp;gt;-&lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;-%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P dir=ltr&gt;That complete this topic , hope you enjoy and Happy Programming &lt;/P&gt;
&lt;P dir=ltr&gt;Ahmed Moosa &lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7624710" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/ahmedmoosa/archive/tags/Inline+Server+Tags/default.aspx">Inline Server Tags</category><category domain="http://weblogs.asp.net/ahmedmoosa/archive/tags/ASP.Net/default.aspx">ASP.Net</category></item></channel></rss>