<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7858007652891377230</id><updated>2024-08-28T06:06:45.451-07:00</updated><category term="Samsumg Star Wallpaper"/><title type='text'>Vi$hu</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vishuwayachal.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://vishuwayachal.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>vishal</name><uri>http://www.blogger.com/profile/02063336886358955477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7858007652891377230.post-5901236726824621447</id><published>2012-01-31T06:58:00.001-08:00</published><updated>2012-01-31T06:58:12.642-08:00</updated><title type='text'>ASP.NET Search Records In GridView Footer And Highlight Results</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1 class=&quot;post-title entry-title&quot;&gt;

&lt;br /&gt;
&lt;/h1&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;

&lt;span class=&quot;post-author vcard&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.csharpaspnetarticles.com/2008/12/search-within-records-in-gridview-with.html&quot;&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;span class=&quot;star-ratings&quot;&gt;
&lt;/span&gt;

&lt;br /&gt;
&lt;b&gt;Search Records In GridView Footer And Highlight Results using ajax in asp.net&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In this example i am populating gridview without using sqlDataSource but by creating Sqlconnection and SqlCommand.&lt;br /&gt;
&lt;br /&gt;
I&#39;ve put a textbox for text to search in footer of gridview using footer
 template , and the search results are highlighted using regular 
expression, i m using AJAX for partial postback and update progress 
template to show search progress&lt;br /&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;codeview1&quot;&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;asp&quot;&gt;&amp;lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot;
CodeFile=&quot;Default.aspx.cs&quot; Inherits=&quot;_Default&quot; %&amp;gt;&lt;/span&gt;

&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DOCTYPE&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;html&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;PUBLIC&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&quot;-//W3C//DTD XHTML 1.1//EN&quot;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;html&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;xmlns&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://www.w3.org/1999/xhtml&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Search and highlight Results in Grdiview
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
.highlight {text-decoration:none; font-weight:bold;
color:black; background:yellow;}
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;form&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;form1&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:ScriptManager&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;ScriptManager1&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:UpdatePanel&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;UpdatePanel1&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ContentTemplate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:GridView&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;grdSearch&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;BackColor&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;white&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BorderColor&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Aqua&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;AutoGenerateColumns&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;false&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ShowFooter&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;true&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;OnRowCommand&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;grdSearch_RowCommand&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;FooterStyle&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BackColor&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;AliceBlue&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;ForeColor&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;AntiqueWhite&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;PagerStyle&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BackColor&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;#99CCCC&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;ForeColor&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;#003399&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;HorizontalAlign&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Left&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;HeaderStyle&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BackColor&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;#003399&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;Font-Bold&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;True&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ForeColor&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;#CCCCFF&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;

&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Columns&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TemplateField&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;HeaderText&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;FirstName&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ItemTemplate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lblFIrstName&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;&amp;lt;%# Highlight(Eval(&quot;FirstName&quot;).ToString()) %&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ItemTemplate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;FooterTemplate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtSearch&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;70px&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Button&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;btnSearch&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;CommandName&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Search&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Search&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;60px&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;FooterTemplate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TemplateField&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:BoundField&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;DataField&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;LastName&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;HeaderText&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;LastName&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Columns&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:GridView&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ContentTemplate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:UpdatePanel&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:UpdateProgress&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;UpdateProgress1&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ProgressTemplate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;br&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;img&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Images/ajax.gif&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Searchig&quot;&lt;/span&gt;  &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ProgressTemplate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:UpdateProgress&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
And the code behind first of all i m populating the Grid by making 
sqlconnection, Sqlcommand and fatching the data from database, than 
binding the data to grid view at Page_Load event after checking the page
 is not loading firs time by by checking flag of isPostBack&lt;br /&gt;
&lt;div class=&quot;codeview&quot;&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Data;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Configuration;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Web;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Web.Security;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Web.UI;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Web.UI.WebControls;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Web.UI.WebControls.WebParts;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Web.UI.HtmlControls;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Text.RegularExpressions;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Data.SqlClient;

&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; _Default : System.Web.UI.Page
{
&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; strConnection =
ConfigurationManager.AppSettings[&lt;span class=&quot;str&quot;&gt;&quot;ConnectionString&quot;&lt;/span&gt;];
&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)
{
&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (!IsPostBack)
{
BindGrid();
}

}
&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; DataTable GetRecords()
{
SqlConnection conn = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlConnection(strConnection);
conn.Open();
SqlCommand cmd = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = &lt;span class=&quot;str&quot;&gt;&quot;Select * from Employees&quot;&lt;/span&gt;;
SqlDataAdapter dAdapter = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlDataAdapter();
dAdapter.SelectCommand = cmd;
DataSet objDs = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; DataSet();
dAdapter.Fill(objDs);
&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; objDs.Tables[0];

}
&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; BindGrid()
{
DataTable dt = GetRecords();
&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (dt.Rows.Count &amp;gt; 0)
{
grdSearch.DataSource = dt;
grdSearch.DataBind();
}
}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Now i&#39;ve written a method to search the text within results of GridView, which user enter in the TextBox to search&lt;br /&gt;
&lt;div class=&quot;codeview1&quot;&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SearchText(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; strSearchText)
{
DataTable dt = GetRecords();
DataView dv = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; DataView(dt);
&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; SearchExpression = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;
&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (!String.IsNullOrEmpty(strSearchText))
{
SearchExpression =
&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;{0} &#39;%{1}%&#39;&quot;&lt;/span&gt;,
grdSearch.SortExpression, strSearchText);

}
dv.RowFilter = &lt;span class=&quot;str&quot;&gt;&quot;FirstName like&quot;&lt;/span&gt; + SearchExpression;
grdSearch.DataSource = dv;
grdSearch.DataBind();
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Next step is to check the command in RowCommand event of grid view,if it
 is what u&#39;ve defined in while creating the button in footer of grid by 
assigning the commandname property, if yes than get the text entered by 
user in textbox placed in footer of gridview by using findcontrol method
 and pass this text to the search method written earlier by making a 
call to that method&lt;br /&gt;
&lt;div class=&quot;codeview1&quot;&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; grdSearch_RowCommand
(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, GridViewCommandEventArgs e)
{
System.Threading.Thread.Sleep(2000);
&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (e.CommandName == &lt;span class=&quot;str&quot;&gt;&quot;Search&quot;&lt;/span&gt;)
{
TextBox txtGrid =
(TextBox)grdSearch.FooterRow.FindControl(&lt;span class=&quot;str&quot;&gt;&quot;txtSearch&quot;&lt;/span&gt;);
SearchText(txtGrid.Text);
}
}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Now to highlight the search text in results i m using regexp and replacing the the words found with highlighted in yellow color&lt;br /&gt;
&lt;div class=&quot;codeview&quot;&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; Highlight(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; InputTxt)
{
GridViewRow gvr = grdSearch.FooterRow;
&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (gvr != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)
{
TextBox txtExample =
(TextBox)grdSearch.FooterRow.FindControl(&lt;span class=&quot;str&quot;&gt;&quot;txtSearch&quot;&lt;/span&gt;);

&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (txtExample.Text != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)
{
&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; strSearch = txtExample.Text;
&lt;span class=&quot;rem&quot;&gt;//string Search_Str = txtGrid.Text.ToString();&lt;/span&gt;
&lt;span class=&quot;rem&quot;&gt;// Setup the regular expression &lt;/span&gt;
&lt;span class=&quot;rem&quot;&gt;//and add the Or operator.&lt;/span&gt;

Regex RegExp =
&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Regex(strSearch.Replace(&lt;span class=&quot;str&quot;&gt;&quot; &quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;|&quot;&lt;/span&gt;).Trim(),
RegexOptions.IgnoreCase);


&lt;span class=&quot;rem&quot;&gt;//Highlight keywords by calling the delegate &lt;/span&gt;
&lt;span class=&quot;rem&quot;&gt;//each time a keyword is found.&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt;
RegExp.Replace(InputTxt, &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; MatchEvaluator(ReplaceKeyWords));

&lt;span class=&quot;rem&quot;&gt;// Set the RegExp to null.&lt;/span&gt;
RegExp = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;

}
&lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; InputTxt;
}
&lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
{
&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; InputTxt;
}
}

&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; ReplaceKeyWords(Match m)
{
&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;span class=highlight&amp;gt;&quot;&lt;/span&gt; + m.Value + &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;/span&amp;gt;&quot;&lt;/span&gt;;
}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Download the sample code attached &lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.box.net/shared/at89h0sdmm&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5276726164752557890&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcWoFJ_bUdqMSsHTW2boK_QuOCFdF4PY_PKuq_mV2cdc4PT61UOJCtWsjoXzhbhyphenhyphenT962ZEpXcst2Te13fX_7Os5F17QRwJMSkHtQgXJeyg04z1U9jDvz8hf1cVXOzqGJvLP0v7o5JnpWYC/s400/download.jpg&quot; style=&quot;cursor: pointer; height: 72px; width: 75px;&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vishuwayachal.blogspot.com/feeds/5901236726824621447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/aspnet-search-records-in-gridview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/5901236726824621447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/5901236726824621447'/><link rel='alternate' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/aspnet-search-records-in-gridview.html' title='ASP.NET Search Records In GridView Footer And Highlight Results'/><author><name>vishal</name><uri>http://www.blogger.com/profile/02063336886358955477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcWoFJ_bUdqMSsHTW2boK_QuOCFdF4PY_PKuq_mV2cdc4PT61UOJCtWsjoXzhbhyphenhyphenT962ZEpXcst2Te13fX_7Os5F17QRwJMSkHtQgXJeyg04z1U9jDvz8hf1cVXOzqGJvLP0v7o5JnpWYC/s72-c/download.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7858007652891377230.post-8818423407050034969</id><published>2012-01-29T08:38:00.002-08:00</published><updated>2012-01-29T08:38:35.175-08:00</updated><title type='text'>Hide/Show validator callout control using javascript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 class=&quot;post-title entry-title&quot;&gt;

Hide/Show validator callout control using javascript
&lt;/h3&gt;
&lt;div class=&quot;post-header&quot;&gt;


&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-150078717285977990&quot;&gt;

&lt;div align=&quot;justify&quot;&gt;
In my &lt;a href=&quot;http://sandblogaspnet.blogspot.com/2009/04/calling-validator-controls-from.html&quot; target=&quot;_blank&quot;&gt;previous blog&lt;/a&gt;
 we saw how to call validation controls from javascripts. This blog we 
will see how to show and hide a ASP.NET AJAX’ (AJAXControlToolkit) 
ValidatorCalloutExtender control using javascript. Below is an aspx page
 with a validator callout control.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 400px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td&gt;         &amp;lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;Default.aspx.cs&quot; Inherits=&quot;_Default&quot; %&amp;gt;            &lt;br /&gt;&amp;lt;%@ Register assembly=&quot;AjaxControlToolkit&quot; namespace=&quot;AjaxControlToolkit&quot; tagprefix=&quot;AJAXControls&quot; %&amp;gt;             &lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;&lt;a href=&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%22&quot;&gt;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&lt;/a&gt;&amp;gt;             &lt;br /&gt;&amp;lt;html xmlns=&quot;&lt;a href=&quot;http://www.w3.org/1999/xhtml%22&quot;&gt;http://www.w3.org/1999/xhtml&quot;&lt;/a&gt;&amp;gt;             &lt;br /&gt;&amp;lt;head runat=&quot;server&quot;&amp;gt;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Untitled Page&amp;lt;/title&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=&quot;form1&quot; runat=&quot;server&quot;&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;lt;!--ASP.NET Drop down control--&amp;gt;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:DropDownList ID=&quot;status&quot; runat=&quot;server&quot; &amp;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;lt;asp:ListItem Selected=&quot;True&quot; Text=&quot;Select&quot; Value=&quot;0&quot; /&amp;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;lt;asp:ListItem Text=&quot;One&quot; /&amp;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;lt;asp:ListItem Text=&quot;Two&quot; /&amp;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;lt;asp:ListItem Text=&quot;Three&quot; /&amp;gt;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:DropDownList&amp;gt;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--ASP.NET Required Field Validator to validate the drop down.--&amp;gt;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
 &amp;lt;asp:RequiredFieldValidator ID=&quot;statusValidator&quot; runat=&quot;server&quot; 
ErrorMessage=&quot;Please choose a value other than &#39;Select&#39;&quot;             &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; ControlToValidate=&quot;status&quot; InitialValue=&quot;0&quot; Visible=&quot;true&quot;&amp;gt;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:RequiredFieldValidator&amp;gt;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--Validator callout control--&amp;gt;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;AJAXControls:ValidatorCalloutExtender ID=&quot;statusValidator_ValidatorCalloutExtender&quot;             &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; runat=&quot;server&quot; TargetControlID=&quot;statusValidator&quot;&amp;gt;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/AJAXControls:ValidatorCalloutExtender&amp;gt;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Button ID=&quot;submit&quot; Text=&quot;Submit&quot; OnClientClick=&quot;javascript:return ValidatePage();&quot;             &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; runat=&quot;server&quot; /&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;asp:ScriptManager ID=&quot;ScriptManager1&quot; runat=&quot;server&quot;&amp;gt;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:ScriptManager&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;br /&gt;
       &lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;justify&quot;&gt;
The
 above code has a dropdown control with an ASP.NET required field 
validator control and a validator callout control attached to it. As 
soon as you click the submit button and if there is a validation error 
the error will be popped out in the validator callout control as shown 
below.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 400px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td&gt;&lt;img alt=&quot;Error in Validator callout control&quot; border=&quot;0&quot; height=&quot;54&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP-f-tj6paHWZUXiEqlgbjuJP5UZtKS8dR5d5D_kNyyl_1qHTujakFTcgUe5k4_xjO7bkfoP10F_Fa9BXrdkVYob-Jw7RhLFYwBK3zb8hFPKLZ5diBcIsnWOPHlOoW12GXbxuDs2jTjEjc/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;Error in Validator callout control&quot; width=&quot;274&quot; /&gt;&lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;justify&quot;&gt;
Popping
 of the error message in a validator callout control happens 
automatically. But there may be scenario where you would like to hide or
 show the validator control using javascript. The below sample code does
 exactly that.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 400px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td&gt;         &amp;lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&amp;gt;            &lt;br /&gt;function ValidatePage()             &lt;br /&gt;{&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; //Function which calls the whole validation for the page.             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Page_ClientValidate())&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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 true;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else             &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; hideValidatorCallout();             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }             &lt;br /&gt;}             &lt;br /&gt;//User defined method which hides the AjaxControlToolkit ValidatorCalloutExtender control             &lt;br /&gt;function hideValidatorCallout()             &lt;br /&gt;{             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Below code hides the active AjaxControlToolkit ValidatorCalloutExtender control.             &lt;br /&gt;AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout.hide();             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setTimeout(showValidatorCallout, 3000);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;} &lt;br /&gt;
          function showValidatorCallout()            &lt;br /&gt;{             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Gets the AjaxControlToolkit ValidatorCalloutExtender control using the $find method.             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
 AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout = 
$find(&#39;&amp;lt;% =statusValidator_ValidatorCalloutExtender.ClientID %&amp;gt;&#39;);
             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Below code unhides the AjaxControlToolkit ValidatorCalloutExtender control.             &lt;br /&gt;AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout.show(true);             &lt;br /&gt;}             &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
       &lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;justify&quot;&gt;
From
 the above code we can see that there is a code something like this 
“AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout”. The 
_currentCallout property will hold the current validator callout 
control. Whenever there is a validation failure and if there is 
validator callout control associated with validator control, the 
_currentCallout property will be assigned the validator callout control.
 To hide the validator callout control you need to use the “hide”&amp;nbsp; 
javascript function along with the _currentCallout property as shown 
below.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 400px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td&gt;AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout.hide();&lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;justify&quot;&gt;
At
 any given point the _currentCallout property will have only one 
validator callout assigned, this is to avoid the confusion or dirtiness 
which can arise by showing all the validator callout control. If all the
 validator callouts are shown when multiple validation fails then the 
screen will be cluttered with all the validator callouts popping here 
and there. To avoid this cluttered view this approach of showing only 
one validator callout control has been taken.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
Similarly
 to show the validator callout control you can use the “show” javascript
 method along with _currentCallout property as shown below.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 400px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td&gt;         //Gets the AjaxControlToolkit ValidatorCalloutExtender control using the $find method.            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
 AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout = 
$find(&#39;&amp;lt;% =statusValidator_ValidatorCalloutExtender.ClientID %&amp;gt;&#39;);
             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Below code unhides the AjaxControlToolkit ValidatorCalloutExtender control.             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout.show(true);&lt;br /&gt;
       &lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;justify&quot;&gt;
But the above code if used just like that can throw the following error.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 400px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;Microsoft JScript runtime error: &#39;this._popupBehavior&#39; is null or not an object&lt;/span&gt;&lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;justify&quot;&gt;
The reason why this happens is that we have not called either &lt;a href=&quot;http://sandblogaspnet.blogspot.com/2009/04/calling-validator-controls-from.html&quot; target=&quot;_blank&quot;&gt;ValidatorEnable&lt;/a&gt; or &lt;a href=&quot;http://sandblogaspnet.blogspot.com/2009/04/calling-validator-controls-from.html&quot; target=&quot;_blank&quot;&gt;ValidatorValidate&lt;/a&gt;
 javascript functions. These two functions set the necessary things, 
like _popupBehavior property, for the validator control to work 
properly. Validator callout controls are not meant to be shown directly 
they are actually extender controls which extend the functionality of 
the validation control and these controls are shown automatically when a
 validator control’ validation condition fails. So if you want to show a
 validator callout function just call ValidatorEnable or 
ValidatorValidate javascript function. &lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
That’ 
about it, on how to hide and show validator callout controls using 
javascript. I know I have not mentioned anything about “$find” 
javascript function. We will have a discussion on this in my &lt;a href=&quot;http://sandblogaspnet.blogspot.com/2009/06/difference-between-get-and-find.html&quot; target=&quot;_blank&quot;&gt;subsequent blog&lt;/a&gt;. For the time being just understand it as a shortcut method to find a component. In our &lt;a href=&quot;http://sandblogaspnet.blogspot.com/2009/04/hideshow-validator-callout-control.html&quot; target=&quot;_blank&quot;&gt;next blog&lt;/a&gt; we will see how to set focus to a particular tab in the AjaxControlToolkit’ tab container control.&lt;/div&gt;
&lt;strong&gt;&lt;u&gt;Some important methods of ValidatorCallout controls&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
  &lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 407px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;&lt;strong&gt;Methods/Properties&lt;/strong&gt;&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;_getErrorMessage()&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Gets/returns the error message&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;get_closeImageUrl()&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Gets/returns the close image url at the top rightmost corner of the validator callout control. Default is an x mark.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;get_isOpen()&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Gets/returns a boolean value indicating whether the validator callout is opened or not.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;get_warningIconImageUrl()&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Gets/returns the warning icon image’ url. Default is an exclamation mark inside a triangle.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;get_width()&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Gets/returns the width of the validator callout control.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;hide()&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Function to hide the validator callout control.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;set_closeImageUrl(imageUrl)&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Function to set the close image url. One can use this method to change the default X mark.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;set_warningIconImageUrl(imageUrl)&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Function to set the warning image. One can use this function to change the default exclamation image used for warning.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;set_width(int)&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Function used to set the width of the validator callout control.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;show()&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;To show the validator callout control.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;_closeImageUrl&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Property to get/set the close image.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;_warningIconImageUrl&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Property to get/set the warning image.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;_width&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Property to get/set the width of the validator callout control&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;_popupBehavior&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Property using which one can work with the pop up behaviour of the validator callout control.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;_errorMessageCell&lt;/td&gt;        &lt;td width=&quot;261&quot;&gt;Property using which one can modify the error message.&lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;&lt;u&gt;Some methods of ValidatorCallout._popupBehavior property&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
  &lt;div align=&quot;justify&quot;&gt;
Below
 are listed few of the _methods of _popupBehavior property of validator 
callout function. These methods are available with only _popupBehavior 
property. If one wants use these methods then one has retrieve the 
_popupBehavior property from&amp;nbsp; validator callout control by any of the 
following two means shown below.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 405px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td width=&quot;403&quot;&gt;         //Retrieving the validator callout control using the $find helper method.           &lt;br /&gt;var valCallout = $find(&#39;&amp;lt;%=statusValidator_ValidatorCalloutExtender.ClientID %&amp;gt;&#39;);            &lt;br /&gt;//Get the _popupBehavior property in a variant object and then             &lt;br /&gt;//use the required methods.            &lt;br /&gt;var popUpBehavior = valCallout._popupBehavior;            &lt;br /&gt;popUpBehavior.set_x(10);            &lt;br /&gt;popUpBehavior.set_y(20);            &lt;br /&gt;//Directly use the methods along with the _popupBehavior property as shown below.            &lt;br /&gt;valCallout._popupBehavior.set_x(20);            &lt;br /&gt;valCallout._popupBehavior.set_y(30);&lt;br /&gt;
       &lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;justify&quot;&gt;
After retrieving the _popupBehavior property by any of the above means you can use the following methods.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 404px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;116&quot;&gt;&lt;strong&gt;Methods/Properties&lt;/strong&gt;&lt;/td&gt;        &lt;td width=&quot;286&quot;&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;116&quot;&gt;get_x()&lt;/td&gt;        &lt;td width=&quot;286&quot;&gt;Method to get the X coordinates of the validator callout control&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;116&quot;&gt;get_y()&lt;/td&gt;        &lt;td width=&quot;286&quot;&gt;Method to get the Y coordinates of the validator callout control.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;116&quot;&gt;get_visible()&lt;/td&gt;        &lt;td width=&quot;286&quot;&gt;Methods that returns a boolean value specifying whether the validator callout control is visible or not.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;116&quot;&gt;set_x(x_coordinate)&lt;/td&gt;        &lt;td width=&quot;286&quot;&gt;Method to set the X coordinate for the validator callout control. Method takes an integer value as an argument.&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;116&quot;&gt;set_y(y_coordinate)&lt;/td&gt;        &lt;td width=&quot;286&quot;&gt;Method to set the Y coordinate for the validator callout control. Method takes an integer value as an argument.&lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;&lt;u&gt;Some methods of ValidatorCallout._errorMessageCell property&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
  &lt;div align=&quot;justify&quot;&gt;
Since
 _errorMessageCell returns a TD (cell) object there is nothing much new 
it has all the methods/properties corresponding to a cell object. One 
use of this property is to change the error message of the validator 
callout extendor control using javascript. To change the error message 
using javascript see the code below.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 400px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td&gt;         //Retrieving the validator callout control using the $find helper method.           &lt;br /&gt;var valCallout = $find(&#39;&amp;lt;%=statusValidator_ValidatorCalloutExtender.ClientID %&amp;gt;&#39;);            &lt;br /&gt;//Get the error message cell.            &lt;br /&gt;var messageCell = valCallout._errorMessageCell;             &lt;br /&gt;//Changing the error message.            &lt;br /&gt;messageCell.innerHTML = &quot;Changed:)&quot;;&lt;br /&gt;
       &lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;&lt;u&gt;Mail from my blog reader&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
  Recently
 one of my blog reader mailed me across some problems he was facing with
 validator callout control. For the benefit of the readers I am pasting 
the mail chain discussion here, with prior permission from the reader 
who mailed me.&lt;br /&gt;
  &lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 400px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td&gt;         Hey Sandeep, how are you? &lt;br /&gt;
          I&#39;ve read your amazing article on: &lt;br /&gt;
          &lt;a href=&quot;http://sandblogaspnet.blogspot.com/2009/04/&quot;&gt;http://sandblogaspnet.blogspot.com/2009/04/&lt;/a&gt;            &lt;br /&gt;setting-focus-to-particular-tab-in.html &lt;br /&gt;
          thank you very much, it really help me! &lt;br /&gt;
          So, I want to call all validators, and them call the specific callout,           &lt;br /&gt;since we can access&amp;nbsp; Page_Validators[validatorIndex]... &lt;br /&gt;
          I could execute all the validators, but now I need to know the name of           &lt;br /&gt;validator to call the callout. &lt;br /&gt;
           var validator = Page_Validators[validatorIndex]; &lt;br /&gt;
          do you know how to get the id of the validator? &lt;br /&gt;
          validator.Id ? validator.ClientId ? &lt;br /&gt;
          thank you ! &lt;br /&gt;
          this is my solution for now: &lt;br /&gt;
           &amp;lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&amp;gt;           &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var Page_Callout = new Array(&quot;&amp;lt;%            &lt;br /&gt;=statusValidator_ValidatorCalloutExtender.ClientID %&amp;gt;&quot;); &lt;br /&gt;
          &amp;nbsp;&amp;nbsp;&amp;nbsp; function ValidatePage() { &lt;br /&gt;
          &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (typeof (Page_Validators) == &quot;undefined&quot;) return; &lt;br /&gt;
          &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var noOfValidators = Page_Validators.length; &lt;br /&gt;
          &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var validatorIndex = 0; validatorIndex &amp;lt; noOfValidators;           &lt;br /&gt;validatorIndex++)            &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var validator = Page_Validators[validatorIndex]; &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; ValidatorValidate(validator); &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; if (!validator.isvalid) { &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; var tabPanel = validator.parentElement.control;           &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; var tabContainer = tabPanel.get_owner();            &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; tabContainer.set_activeTabIndex(tabPanel.get_tabIndex()); &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; showValidatorCallout($find(Page_Callout[validatorIndex])); &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; return false;           &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; }            &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; return true;            &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; } &lt;br /&gt;
          &amp;nbsp;&amp;nbsp;&amp;nbsp; function hideValidatorCallout() {           &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout.hide();            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
          &amp;nbsp;&amp;nbsp;&amp;nbsp; function showValidatorCallout(currrentCallout) {           &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AjaxControlToolkit.ValidatorCalloutBehavior.            &lt;br /&gt;_currentCallout =currrentCallout;            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AjaxControlToolkit.ValidatorCalloutBehavior.            &lt;br /&gt;_currentCallout.show(true);            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }            &lt;br /&gt;&amp;lt;/script&amp;gt; &lt;br /&gt;
          &lt;strong&gt;&lt;u&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;-- My reply--&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;            &lt;br /&gt;Hi XYZ, &lt;br /&gt;
          If
 I am not wrong when you are calling the function &quot;showValidatorCallout&quot;
 it doesn&#39;t show the validator callout in the tab? Am I right? If yes I 
have also faced the same problem. I solved this by a dirty hack. So what
 I did is something like this. &lt;br /&gt;
          ValidatorEnable(dropDownValidator); //Calling the validator callout for the first time. Just a dummy call.           &lt;br /&gt;if (!dropDownValidator.isvalid)             &lt;br /&gt;{             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setActiveTabIndex(0); //Method which sets the active index.            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hideCurrCallout(); //Method which hide the current validator callout             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ValidatorEnable(dropDownValidator); //Calling ValidatorEnable method for the second time.            &lt;br /&gt;} &lt;br /&gt;
          Hope
 this helps. So when you work with tab you have to use the above hack to
 display validator callout control. I didn&#39;t get much time to find out 
the reason behind but will try find out. &lt;br /&gt;
          &lt;strong&gt;&lt;u&gt;&lt;span style=&quot;color: magenta;&quot;&gt;--Response from the reader--&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;            &lt;br /&gt;Hey Sandeep, thanks... &lt;br /&gt;
          I&#39;ve another problem with the callout&#39;s... Please, take a loot in that           &lt;br /&gt;image attached.. do you have this problem ?            &lt;br /&gt;When the field is in the right side... the callout create scrolls and            &lt;br /&gt;expand the width of the page :( &lt;br /&gt;
          Do you know how to avoid this ? &lt;br /&gt;
          &lt;u&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&lt;strong&gt;--My reply--                 &lt;/strong&gt;&lt;/span&gt;&lt;/u&gt;Hope
 your previous problem has been solved. This is the auto behaviour of 
the browser where if something is dynamically created and it exceeds the
 width of the browser it will give you a scroll bar. For this you can 
set the X and Y coordinates of the callout control so that they won&#39;t 
exceed the width of the browser. To set the X and Y coordinates you can 
use the following code. &lt;br /&gt;
          //Retrieving the validator callout control using the $find shortcut method.           &lt;br /&gt;var valCallout = $find(&#39;&amp;lt;%=statusValidator_ValidatorCalloutExtender.ClientID %&amp;gt;&#39;);            &lt;br /&gt;//Setting the X coordinates            &lt;br /&gt;valCallout.validatorCallout._popupBehavior.set_x(xCordinates);            &lt;br /&gt;//Setting the X coordinates            &lt;br /&gt;valCallout.validatorCallout._popupBehavior.set_y(yCordinates) &lt;br /&gt;
          or you can use the below code. &lt;br /&gt;
          AjaxControlToolkit.ValidatorCalloutBehavior.           &lt;br /&gt;_currentCallout._popupBehavior.set_x(xCordinates);            &lt;br /&gt;AjaxControlToolkit.ValidatorCalloutBehavior.            &lt;br /&gt;_currentCallout._popupBehavior.set_y(yCordinates) &lt;br /&gt;
          Hope this solves your problem. &lt;br /&gt;
          &lt;strong&gt;&lt;u&gt;&lt;span style=&quot;color: magenta;&quot;&gt;--Reader response--&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;            &lt;br /&gt;Hi Sandeep, &lt;br /&gt;
          Yeah... you solve the problems :) &lt;br /&gt;
          thank you again. &lt;br /&gt;
          cheers,&lt;br /&gt;
       &lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;span class=&quot;post-author vcard&quot;&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vishuwayachal.blogspot.com/feeds/8818423407050034969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/hideshow-validator-callout-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/8818423407050034969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/8818423407050034969'/><link rel='alternate' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/hideshow-validator-callout-control.html' title='Hide/Show validator callout control using javascript'/><author><name>vishal</name><uri>http://www.blogger.com/profile/02063336886358955477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP-f-tj6paHWZUXiEqlgbjuJP5UZtKS8dR5d5D_kNyyl_1qHTujakFTcgUe5k4_xjO7bkfoP10F_Fa9BXrdkVYob-Jw7RhLFYwBK3zb8hFPKLZ5diBcIsnWOPHlOoW12GXbxuDs2jTjEjc/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7858007652891377230.post-8412345787897384414</id><published>2012-01-29T08:38:00.000-08:00</published><updated>2012-01-29T08:38:02.374-08:00</updated><title type='text'>Trim function in javascript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 class=&quot;post-title entry-title&quot;&gt;

Trim function in javascript
&lt;/h3&gt;
&lt;div class=&quot;post-header&quot;&gt;


&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;strong&gt;&lt;u&gt;Trim function in javascript&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
One
 important function which we miss very much while working with string 
object in javascript is the trim function. Not anymore. If you are using
 ASP.NET you can very well make use of “ValidatorTrim” function to trim 
both leading and trailing spaces. E.g. is shown below.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 400px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td&gt;         var testString = &#39;&amp;nbsp;&amp;nbsp; Test trail&amp;nbsp;&amp;nbsp;&amp;nbsp; text&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;;           &lt;br /&gt;//Below code removes spaces before and after the word.            &lt;br /&gt;testString = ValidatorTrim(testString);&lt;br /&gt;
       &lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;justify&quot;&gt;
In
 the above e.g. ValidatorTrim removes the leading and trailing spaces in
 the “&amp;nbsp;&amp;nbsp; Test text&amp;nbsp; ” string and returns “Test Text” as the string. So 
whenever you need to trim spaces in javascript then go ahead and use 
“ValidatorTrim” function to trim spaces.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
If you keep a breakpoint on the ValidatorTrim function and step into the function you can see the following code.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 400px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td&gt;         function ValidatorTrim(s) {           &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (m == null) ? &quot;&quot; : m[1];            &lt;br /&gt;}&lt;br /&gt;
       &lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
One
 can see from the above code that Regular Expression is used to pick out
 the text without the trailing and leading spaces. People who are not 
ASP.NET developers can very well implement the same logic and can have 
their own javascript trim function. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vishuwayachal.blogspot.com/feeds/8412345787897384414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/trim-function-in-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/8412345787897384414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/8412345787897384414'/><link rel='alternate' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/trim-function-in-javascript.html' title='Trim function in javascript'/><author><name>vishal</name><uri>http://www.blogger.com/profile/02063336886358955477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7858007652891377230.post-2037774742104154929</id><published>2012-01-29T08:35:00.001-08:00</published><updated>2012-01-29T08:35:16.052-08:00</updated><title type='text'>Data type validation using validation control</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 class=&quot;post-title entry-title&quot;&gt;

Data type validation using validation control
&lt;/h3&gt;
&lt;div class=&quot;post-header&quot;&gt;


&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
While developing ASP.NET application you would have 
come across scenarios where you would like to validate whether the value
 entered is of a particular data type. The options available with an 
ASP.NET developer is to write javascript functions to check whether the 
entered value complies with a data type or make the page postback and 
check the data type in server side. These two options are time 
consuming. Is there any simple way of doing this? The answer is to the 
question is “YES”. One can make use of compare validator to accomplish 
the task very easily. Lets see how.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
To compare 
whether the entered value is of a particular data type one should make 
sure that the “Operator” property of compare validator should be 
“DataTypeCheck” and the “Type” property should be the data type you want
 to check. These two things are the only requirement to validate the 
data type. Compare validator supports validation for Currency, Date, 
Double, Integer and String data type. Below is a sample code which tries
 to check all these data types.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 410px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td&gt;         Enter string: &amp;lt;asp:TextBox ID=&quot;txtString&quot; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;           &lt;br /&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;lt;asp:CompareValidator
 ID=&quot;cmpVldString&quot; runat=&quot;server&quot; ErrorMessage=&quot;Not a valid string.&quot; 
ControlToValidate=&quot;txtString&quot;             &lt;br /&gt;Type=&quot;String&quot; Operator=&quot;DataTypeCheck&quot;&amp;gt; &amp;lt;/asp:CompareValidator&amp;gt;&lt;/span&gt;&amp;lt;br /&amp;gt;            &lt;br /&gt;Enter integer: &amp;lt;asp:TextBox ID=&quot;txtInt&quot; runat=&quot;server&quot;&amp;gt; &amp;lt;/asp:TextBox&amp;gt;            &lt;br /&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;lt;asp:CompareValidator
 ID=&quot;CompareValidator1&quot; runat=&quot;server&quot; ErrorMessage=&quot;Not a valid 
Integer.&quot; ControlToValidate=&quot;txtInt&quot;             &lt;br /&gt; Type=&quot;Integer&quot; Operator=&quot;DataTypeCheck&quot;&amp;gt; &amp;lt;/asp:CompareValidator&amp;gt;&lt;/span&gt;&amp;lt;br /&amp;gt;            &lt;br /&gt;Enter double: &amp;lt;asp:TextBox ID=&quot;txtDouble&quot; runat=&quot;server&quot;&amp;gt; &amp;lt;/asp:TextBox&amp;gt;            &lt;br /&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;lt;asp:CompareValidator
 ID=&quot;CompareValidator2&quot; runat=&quot;server&quot; ErrorMessage=&quot;Not a valid 
double.&quot; ControlToValidate=&quot;txtDouble&quot;             &lt;br /&gt; Type=&quot;Double&quot; Operator=&quot;DataTypeCheck&quot;&amp;gt; &amp;lt;/asp:CompareValidator&amp;gt;&lt;/span&gt;&amp;lt;br /&amp;gt;            &lt;br /&gt;Enter date: &amp;lt;asp:TextBox ID=&quot;txtDate&quot; runat=&quot;server&quot;&amp;gt; &amp;lt;/asp:TextBox&amp;gt;            &lt;br /&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;lt;asp:CompareValidator
 ID=&quot;cmpVldDate&quot; runat=&quot;server&quot; ErrorMessage=&quot;Not a valid date.&quot; 
ControlToValidate=&quot;txtDate&quot;             &lt;br /&gt; Type=&quot;Date&quot; Operator=&quot;DataTypeCheck&quot; &amp;gt; &amp;lt;/asp:CompareValidator&amp;gt;&lt;/span&gt;&amp;lt;br /&amp;gt;            &lt;br /&gt;Enter currency: &amp;lt;asp:TextBox ID=&quot;txtCurrency&quot; runat=&quot;server&quot;&amp;gt; &amp;lt;/asp:TextBox&amp;gt;            &lt;br /&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;lt;asp:CompareValidator
 ID=&quot;cmpVldCurrency&quot; runat=&quot;server&quot; ErrorMessage=&quot;Not a valid 
currencys.&quot; ControlToValidate=&quot;txtCurrency&quot; Type=&quot;Currency&quot; 
Operator=&quot;DataTypeCheck&quot; &amp;gt; &amp;lt;/asp:CompareValidator&amp;gt;&lt;/span&gt;&amp;lt;br /&amp;gt;            &lt;br /&gt;&amp;lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; Text=&quot;Button&quot; /&amp;gt;&lt;br /&gt;
       &lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;justify&quot;&gt;
In
 the above code sample you can see that I am checking the datatype for 
string, Integer, date, double and finally currency. Isn’t it so easy to 
check the data type? &lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
Now since we are 
validating date you would like to check against a particular format say 
“DD/MM/YYYY”. The default date format against which the compare 
validator checks the date is “YYYY/MM/DD”. One way specify the date 
format is to assign the page’ culture to the required culture which 
supports your date format. Say we want to check “DD/MM/YYYY” then we can
 set the following in the code behind.&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; style=&quot;width: 410px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td&gt;         protected void Page_Load(object sender, EventArgs e)           &lt;br /&gt;{            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;Page.Culture = &quot;hi-IN&quot;;&lt;/span&gt;&lt;br /&gt;
       &lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;justify&quot;&gt;
In
 the above code we are setting the culture for the page as Hindi-India 
which will accept the date in “DD/MM&#39;/YYYY” format. Another way 
specifying the format in compare validator is to assign culture to the 
control which is specified in “ControlToValidate” property of the 
compare validator. For e.g. you have date picker assigned to a compare 
validator then assigning the culture or date format to the date picker 
will do the trick. As such there is no way to specify date format or 
culture to a compare validator. &lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vishuwayachal.blogspot.com/feeds/2037774742104154929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/data-type-validation-using-validation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/2037774742104154929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/2037774742104154929'/><link rel='alternate' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/data-type-validation-using-validation.html' title='Data type validation using validation control'/><author><name>vishal</name><uri>http://www.blogger.com/profile/02063336886358955477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7858007652891377230.post-235699273125481803</id><published>2012-01-29T08:34:00.001-08:00</published><updated>2012-01-29T08:34:29.303-08:00</updated><title type='text'>Calling web service using javascript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 class=&quot;post-title entry-title&quot;&gt;

Calling web service using javascript. Part -3
&lt;/h3&gt;
&lt;div class=&quot;post-header&quot;&gt;


&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
In the &lt;a href=&quot;http://sandblogaspnet.blogspot.com/2010/03/calling-web-service-using-javascript.html&quot; target=&quot;_blank&quot;&gt;part 1&lt;/a&gt; of this blog we saw how to invoke web service methods using pure javascript and in &lt;a href=&quot;http://sandblogaspnet.blogspot.com/2010/04/calling-web-service-using-javascript.html&quot; target=&quot;_blank&quot;&gt;part 2&lt;/a&gt;
 we made use of web service behavior to invoke web methods. The previous
 two blogs were not dependent on server technologies used by the user 
but this blog will have that constraint because we will have a look at 
how to invoke web methods using “ScriptManager”. “ScriptManager” is an 
ASP.NET server side control which is key to AJAX functionality in 
ASP.NET. Without any further delay let’ see our first web method 
invocation using “ScriptManager”. For this blog we will making use of 
the same web service as we have used in our previous two blogs. Below is
 the code for the first web service method we are going to invoke. &lt;/div&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; color: #f4f4f4; cursor: text; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 97.5%;&quot;&gt;
 &lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; ScriptManagerService&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;//The attribute which makes the web service callable from script.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;    [System.Web.Script.Services.ScriptService]&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; TestService : System.Web.Services.WebService&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;        [WebMethod]&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; HelloWorld()&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;        {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;            &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;        }&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;    }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
The
 above web service code is pretty straight forward. We have a simple 
“HelloWorld” method which returns a string. What makes this web service 
special is the “[System.Web.Script.Services.ScriptService]” attribute 
added on top of the “TestService” web service class. The attribute makes
 the web service callable from JavaScript. Also when the proxy classes 
are generated the attribute generates JavaScript object corresponding to
 the web service class. Once the web service is created now we need to 
create our web page to invoke the web method. Create a new aspx page and
 add a “ScriptManager” control to it. Sample aspx page with the 
“ScriptManager” tag is added below.&lt;/div&gt;
&lt;div color=&quot;#f4f4f4&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; id=&quot;codeSnippetWrapper&quot; size=&quot;8pt&quot; style=&quot;border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;&amp;lt;body&amp;gt;&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;script language=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;javascript&quot;&lt;/span&gt; type=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;function invokeSimpleWebMethod()&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;    ScriptManagerService.TestService.HelloWorld(handleResult);    &lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;} &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt; &lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;function handleResult(result)&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    alert(result);&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;   &amp;lt;form id=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;form1&quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;server&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &amp;lt;div&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;        &amp;lt;asp:ScriptManager ID=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;scrMgr&quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;server&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;            &amp;lt;Services&amp;gt;&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;                &amp;lt;asp:ServiceReference Path=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;TestService.asmx&quot;&lt;/span&gt; /&amp;gt;                &lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;            &amp;lt;/Services&amp;gt;&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;        &amp;lt;/asp:ScriptManager&amp;gt;&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;        &amp;lt;asp:Button ID=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;btnHW&quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;server&quot;&lt;/span&gt; Text=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Hello World&quot;&lt;/span&gt; OnClientClick=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;invokeSimpleWebMethod();&quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &amp;lt;/form&amp;gt; &lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
In
 the above code we can see that we have a “ScriptManager” server control
 added. And inside the “Services” tag we have added reference to our 
local web service using the “ServiceReference” tag. The path attribute 
of the “ServiceReference” tag has the url of the web service which needs
 to be invoked. You can add multiple web services by adding additional 
“ServiceReference” tags. What ASP.NET does here is that it generates 
JavaScript proxy classes for each of the web services mentioned in the 
“ServiceReference” tag. All the auto generated JavaScript proxy classes 
derive from “Sys.Net.WebServiceProxy”.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
Also we 
have an ASP.NET Button server control which calls a 
“invokeSimpleWebMethod” javascript method on its “OnClientClick” event. 
In the “invokeSimpleWebMethod” javascript method we have made use of the
 namespace (in which the web service is defined) followed by the web 
service name and finally the method name which needs to be invoked. 
Behind the scene ASP.NET has done the extra work of registering the 
namespace and creating the proxy classes and also adding the methods 
defined inside the web service into a proxy JavaScript class. If you 
notice the “HelloWorld” method takes an argument. The argument is 
nothing but the name of the JavaScript function which needs to be 
invoked when the web service method has been successfully executed and 
results are returned to the browser. You can also pass the name of the 
function which needs to be invoked when the web service method 
invocation request fails. We will see the same shortly. The 
“handleResult” JavaScript method gets called when the asynchronous 
request is successfully returned. The method gracefully displays the 
result in an alert message box.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
That’ about how to
 use the “ScriptManager” server control to invoke a web service methods 
i.e. namespace followed by class name followed by the method name. One 
thing to note is that “ScriptManager” control can only be used to call 
web services in the same domain. Now lets see how to pass parameters to 
web methods.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;strong&gt;&lt;u&gt;Passing parameters to web method&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
We will use the following web method to see how we can pass parameters by using “ScriptManager”.&lt;/div&gt;
&lt;div color=&quot;#f4f4f4&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; id=&quot;codeSnippetWrapper&quot; size=&quot;8pt&quot; style=&quot;border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;[WebMethod]&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; CombineName(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; firstName, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; midleName, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; lastName)&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;      &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;.Concat(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;.Concat(firstName, &lt;span style=&quot;color: #006080;&quot;&gt;&quot; - &quot;&lt;/span&gt;, midleName), &lt;span style=&quot;color: #006080;&quot;&gt;&quot; - &quot;&lt;/span&gt;, lastName);&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
The above method is pretty straight and it is the same method which I have used in my &lt;a href=&quot;http://sandblogaspnet.blogspot.com/2010/04/calling-web-service-using-javascript.html&quot; target=&quot;_blank&quot;&gt;previous blog&lt;/a&gt;.
 The method takes three string arguments and concatenates them and 
returns them as a single string. Now lets see how we can pass the three 
parameters from JavaScript.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
Below is the JavaScript method which invokes the web method with the three string parameters.&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; webMethodWithParams()&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{    &lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    ScriptManagerService.TestService.CombineName(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Sandeep&quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080;&quot;&gt;&quot; &quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080;&quot;&gt;&quot;P.R&quot;&lt;/span&gt;, handleResult, handleError);&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;In
 the above JavaScript function we are invoking the “CombineName” method 
the same way we invoked the “HelloWorld” web method. But the difference 
here is that instead of the callback function as the first argument we 
are passing the arguments first, followed by the success callback 
function name and then the failure callback function. The funda behind 
is simple, if your web method accepted three parameters pass them first 
in the same order as defined in the web method followed by the callback 
methods. Similarly if the web method takes different number of 
parameters then make sure that, that many number of parameters are 
passed first followed by the success callback function. Success callback
 and error callback functions are optional. Our “handleError” javascript
 function looks something like this.&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; handleError(error)&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    alert(error.get_message());&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
The
 above “handleError” javascript function is pretty straight forward. It 
takes an error object as one of the argument. The error object passed by
 the system has various methods and properties to retrieve the details 
of the exception happened on the server side. Some of the methods and 
properties are as follows.&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;div align=&quot;justify&quot;&gt;
get_exceptionType
 method or _exceptionType field/property can be used to get the type of 
exception raised by the server like “System.Exception”.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;justify&quot;&gt;
get_message method or _message field/property can be used to get the error message returned by the server.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;justify&quot;&gt;
_stackTrace field/property or get_stackTrace method can be used to get the stack trace of the error from the server.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;justify&quot;&gt;
get_statusCode method or _statusCode field/property can be used to retrieve the HTML status code returned from the server.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div align=&quot;justify&quot;&gt;
The
 error object which is passed to the “handleError” JavaScript function 
is of type “Sys.Net.WebServiceError”. “Sys.Net.WebServiceError” is a 
simple class with the above explained methods or fields/properties.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
Now the next step is to pass complex objects from JavaScript to a web method. Lets see how that can be accomplished.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;strong&gt;&lt;u&gt;Passing complex objects&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
Let see the code of the web method which accepts a complex object and processes it.&lt;/div&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 100%;&quot;&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;[WebMethod]&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; GetCar(Car car)&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Model: &quot;&lt;/span&gt; + car.Model + &lt;span style=&quot;color: #006080;&quot;&gt;&quot;, Color: &quot;&lt;/span&gt; + car.Color; &lt;span style=&quot;color: green;&quot;&gt;//&quot;, Cubic capacity: &quot;;//+ car.CC + &lt;/span&gt;&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
The
 above web method doesn’t have rocket science in it, it just takes a 
complex object of type “Car” and concatenates the properties and returns
 it as a string. Now lets the “Car” class. Its same as that we have used
 in our previous examples.&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; color: #f4f4f4; cursor: text; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 500px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 97.5%;&quot;&gt;
&lt;div color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; id=&quot;codeSnippet&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; Car&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; Model&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    {   get; set; }          &lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt; &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; Color&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    { get; set; }&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt; &lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; Engine CarEngine&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    { get; set; }&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt; &lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; Engine&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; CC&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    { get; set; }&lt;/pre&gt;
&lt;pre color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; size=&quot;8pt&quot; style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; Cylinders&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    { get; set; }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
The
 “Car” class has three properties namely “Model”, “Color” and 
“CarEngine”. “Model” and “Color” are of type string and “CarEngine” is 
again a complex object of type “Engine”. The “Engine” class has two 
properties of type int namely “CC” and “Cylinders”. The above “Car” 
class is the one which we will be passing to the web method from within 
JavaScript using ScripManager. The code is pasted below.&lt;/div&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; color: #f4f4f4; cursor: text; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 500px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 97.5%;&quot;&gt;
&lt;div color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; id=&quot;codeSnippet&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; sendComplexObject()&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;//Create a new Object and assign the same properties as those in the Car class.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; car = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; Object();&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    car.Model = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Ferrari California&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    car.Color = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Ferrari Red&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    car.CarEngine = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; Object()&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    car.CarEngine.CC = 4500&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    car.CarEngine.Cylinders = 12&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;//Execute the web method.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    ScriptManagerService.TestService.GetCar(car, handleResult, handleError);&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
In
 the “sendComplexObject” method we are first creating a “Car” object by 
creating an object of type “Object”. Then to that object we are adding 
all the properties that the “Car” class has. Since JavaScript is a 
dynamic language you can add all the properties by just giving the name 
and the value. As the “Car” class has another complex object, Engine, as
 one of its property named “CarEngine” we are also creating the complex 
engine object also the same way. Once we have created the object we are 
finally executing the web method in the final line of code. Isn’t simple
 to pass complex objects from JavaScript to server. To help us to do 
write such a simple code the ScriptManager does the extra work 
converting the JavaScript objects to server objects. &lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
Below is the JSON way of creating the complex Car object.&lt;/div&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; color: #f4f4f4; cursor: text; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 500px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 97.5%;&quot;&gt;
&lt;div color=&quot;black&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; id=&quot;codeSnippet&quot; size=&quot;8pt&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; sendComplexObject()&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;//Create an object of type &quot;ScriptManagerService.Car&quot; and pass all the properties &lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;//as a javascript string array.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; car = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; ScriptManagerService.Car({&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Model&quot;&lt;/span&gt; : &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Ferrari California&quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Color&quot;&lt;/span&gt; : &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Ferrari Red&quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080;&quot;&gt;&quot;CarEngine&quot;&lt;/span&gt; : {&lt;span style=&quot;color: #006080;&quot;&gt;&quot;CC&quot;&lt;/span&gt; : &lt;span style=&quot;color: #006080;&quot;&gt;&quot;100&quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Cylinders&quot;&lt;/span&gt; : &lt;span style=&quot;color: #006080;&quot;&gt;&quot;5&quot;&lt;/span&gt;}})&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;//Invoke the web method.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    ScriptManagerService.TestService.GetCar(car, handleResult, handleError);&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
In
 the above code we are trying to create a “ScriptManagerService.Car” 
object. This is possible because the ScriptManager generates the Proxy 
classes automatically for us. Now lets see handling a complex type 
returned from the server. It also is quite simple.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;strong&gt;&lt;u&gt;Handling a complex object returned by the server&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
Lets see the web service which returns the complex object.&lt;/div&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; color: #f4f4f4; cursor: text; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 500px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 97.5%;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;[WebMethod]&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; Car GetCarObject()&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; Car&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;        Model = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Ferrari&quot;&lt;/span&gt;,&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;        Color = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Ferrari Red&quot;&lt;/span&gt;,&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;        CarEngine = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; Engine { CC = 2500, Cylinders = 8 },&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;        test = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;test&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    };&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
The
 above web method does the hard work of creating a car object and 
returning the same. We are going to invoke the above web method using 
the ScriptManager and use the very complex object in JavaScript. The 
JavaScript code is pasted below.&lt;/div&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; color: #f4f4f4; cursor: text; direction: ltr; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 500px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4pxfont-family:&#39;Courier New&#39;, courier, monospace; text-align: left; width: 97.5%;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; receiveUseComplexObject()&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;//Invoking the web method that returns complex object.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    ScriptManagerService.TestService.GetCarObject(handleResult, handleError);&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt; &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;//Modified handleResult function&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; handleResult(result)&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;//Using the complex object returned by the web method in JavaScript.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; carDef = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Model: &quot;&lt;/span&gt; + result.Model + &lt;span style=&quot;color: #006080;&quot;&gt;&quot;, Color: &quot;&lt;/span&gt; + result.Color + &lt;span style=&quot;color: #006080;&quot;&gt;&quot;, Engine-CC: &quot;&lt;/span&gt; + result.CarEngine.CC;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    carDef += &lt;span style=&quot;color: #006080;&quot;&gt;&quot;, Engine-Cylinders: &quot;&lt;/span&gt; + result.CarEngine.Cylinders;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    alert(carDef);&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
In
 the “receiveUseComplexObject” we are not doing any drastic than 
invoking the “GetCarObject” web method. The main work is done by the 
modified “handleResult” function. The web method returns a “Car” object,
 the parameter of the “handleResult” also is the JavaScript proxy “Car” 
object representing the server object. The ScriptManager does all the 
work of converting the returned object as a JSON “Car” object. This is 
why we are able to use the properties of the “Car” object as we would do
 in a normal OOPS programming language.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;strong&gt;&lt;u&gt;Calling methods in a page&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;

 Using “ScriptManager” one can access method of a web page as well. One 
catch here is that you can execute only static page methods. To call a 
page method from JavaScript by making use of “ScriptManger” you need to 
add the “WebMethod” attribute to the method you want to call. Lets see 
“.cs” file of a web page.&lt;/div&gt;
&lt;div color=&quot;#f4f4f4&quot; face=&quot;&#39;Courier New&#39;, courier, monospace&quot; id=&quot;codeSnippetWrapper&quot; size=&quot;8pt&quot; style=&quot;border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; line-height: 12pt; margin: 20px 0px 10px; max-height: 500px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; TestPage : System.Web.UI.Page&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    {    }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt; &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    [System.Web.Services.WebMethod]&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; HelloWorld()&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;        &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Hello world&quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    }        &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
As
 mentioned above, we have added the “WebMethod” attribute to a static 
method and that’ it you need to do to make a page method callable by 
“ScriptManager”. In “ScriptManager” you need to set “EnablePageMethods” 
property to “true”. What this property does is it generates a 
“PageMethods” JavaScript class which has the necessary code to call all 
the static page methods which are decorated by the “WebMethod” 
attribute. Lets see the ASPX page and the JavaScript.&lt;/div&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 500px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;%@ Page Language=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;C#&quot;&lt;/span&gt; AutoEventWireup=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;true&quot;&lt;/span&gt; CodeBehind=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;WebSerCalServiceMngr.aspx.cs&quot;&lt;/span&gt; Inherits=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;WebServiceUsingJS.WebSerCalServiceMngr&quot;&lt;/span&gt; %&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt; &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;!DOCTYPE html PUBLIC &lt;span style=&quot;color: #006080;&quot;&gt;&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;&lt;/span&gt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt; &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;html xmlns=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://www.w3.org/1999/xhtml&quot;&lt;/span&gt; &amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;head runat=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;server&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &amp;lt;title&amp;gt;Untitled Page&amp;lt;/title&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;body&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;script language=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;javascript&quot;&lt;/span&gt; type=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;function callPageMethods()&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    PageMethods.HelloWorld(handleResult);&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt; &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;form id=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;form1&quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;server&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &amp;lt;div&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;        &amp;lt;asp:ScriptManager ID=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;scrMgr&quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;server&quot;&lt;/span&gt; EnablePageMethods=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;true&quot;&lt;/span&gt;&amp;gt;   &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;        &amp;lt;/asp:ScriptManager&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;asp:Button ID=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Button3&quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;server&quot;&lt;/span&gt; Text=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Call page method.&quot;&lt;/span&gt; OnClientClick=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;callPageMethods();&quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &amp;lt;/form&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
In
 the above code we have set “EnablePageMethods” property to true and on 
the click of a button we are calling “callPageMethods()” JavaScript 
function. Inside the “callPageMethods” JavaScript function we are making
 use of “PageMethods” proxy class to execute our page method. So with 
“ScriptManager” doing all the extra work at the back, as a developer we 
are having great time. &lt;/div&gt;
&lt;br /&gt;&lt;div align=&quot;justify&quot;&gt;
Try to know more&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vishuwayachal.blogspot.com/feeds/235699273125481803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/calling-web-service-using-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/235699273125481803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/235699273125481803'/><link rel='alternate' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/calling-web-service-using-javascript.html' title='Calling web service using javascript'/><author><name>vishal</name><uri>http://www.blogger.com/profile/02063336886358955477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7858007652891377230.post-6181582312837942608</id><published>2012-01-22T08:40:00.001-08:00</published><updated>2012-01-22T08:40:25.403-08:00</updated><title type='text'>row to column sql server</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
CREATE TABLE [dbo].[ashish](&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [custID] [int] NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Question] [varchar](50) NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [answer] [varchar](20) NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;INSERT INTO ashish values(1000,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;AAA&#39;,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;1&#39;)&lt;br /&gt;INSERT INTO ashish values(1000,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;BBB B&#39;,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;2&#39;)&lt;br /&gt;INSERT INTO ashish values(1000,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;CCC&#39;,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;3&#39;)&lt;br /&gt;INSERT INTO ashish values(1001,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;AAA&#39;,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;2&#39;)&lt;br /&gt;INSERT INTO ashish values(1001,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;BBB B&#39;,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;3&#39;)&lt;br /&gt;INSERT INTO ashish values(1001,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;CCC&#39;,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;3&#39;)&lt;br /&gt;INSERT INTO ashish values(1000,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;DDD&#39;,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;6&#39;)&lt;br /&gt;&lt;br /&gt;Declare @t VARCHAR(10)&lt;br /&gt;Declare @A VARCHAR(1000)&lt;br /&gt;Declare @B VARCHAR(1000)&lt;br /&gt;set @A=&#39;SELECT CustID&#39;&lt;br /&gt;SET @B=&#39;(&#39;&lt;br /&gt;SELECT @A=@A+&#39;,[&#39;+Question+&#39;] as [&#39; +Question+&#39;]&#39;,@B=@B+&#39;[&#39;+Question+&#39;],&#39; FROM (SELECT DISTINCT QUESTION FROM ashish) cur&lt;br /&gt;-- removing last &#39;,&#39; from both &amp;lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&amp;gt;variables&amp;lt;/span&amp;gt;&lt;br /&gt;SET @B=SUBSTRING(@B,1,LEN(@B)-1)&lt;br /&gt;SET @A=@A+ + &#39; FROM (SELECT CustID, Answer, Question FROM ashish) s&amp;nbsp; PIVOT (max(answer) FOR QUESTION IN &#39; +@B+&#39;)) p ORDER BY [CUSTID]; &#39;&lt;br /&gt;exec(@A);&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vishuwayachal.blogspot.com/feeds/6181582312837942608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/row-to-column-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/6181582312837942608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/6181582312837942608'/><link rel='alternate' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/row-to-column-sql-server.html' title='row to column sql server'/><author><name>vishal</name><uri>http://www.blogger.com/profile/02063336886358955477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7858007652891377230.post-3199539609929337106</id><published>2012-01-16T01:23:00.001-08:00</published><updated>2012-01-16T01:23:16.866-08:00</updated><title type='text'>JAVASCRIPT YES NO ALERT</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
function PrintAlert() &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ModalPopups.Confirm(&quot;idConfirm1&quot;,&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; &quot;Print Confirmation&quot;,&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; &quot;&amp;lt;div style=&#39;padding: 25px;text-align:center;&#39;&amp;gt;Print OK ?&amp;lt;/div&amp;gt;&quot;,&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; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yesButtonText: &quot;Yes&quot;,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; noButtonText: &quot;No&quot;,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onYes: &quot;ModalPopupsConfirmYes()&quot;,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onNo: &quot;ModalPopupsConfirmNo()&quot;&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; &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; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; &lt;br /&gt;function ModalPopupsConfirmYes() {&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; // alert(&#39;You pressed Yes&#39;);&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ModalPopups.Close(&quot;idConfirm1&quot;);&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; var printflag = &quot;Y&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; var txtSearchClientID=&quot;&amp;lt;%=Hiddden_grid_value.ClientID%&amp;gt;&quot;;&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; GetPrint(printflag,document.getElementById(txtSearchClientID).value); &lt;br /&gt;}&amp;nbsp;&amp;nbsp; &lt;br /&gt;function ModalPopupsConfirmNo() {&amp;nbsp; &lt;br /&gt;var printflag = &quot;N&quot;; &lt;br /&gt;&amp;nbsp; //&amp;nbsp; alert(&#39;You pressed No&#39;);&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ModalPopups.Cancel(&quot;idConfirm1&quot;);&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var txtSearchClientID=&quot;&amp;lt;%=Hiddden_grid_value.ClientID%&amp;gt;&quot;;&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; GetPrint(printflag,document.getElementById(txtSearchClientID).value); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function GetPrint(print,maxkey)&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(print!=&quot;&quot;)&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; {&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(print);&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; var hfPrintClientID=&quot;&amp;lt;%=hfPrint.ClientID%&amp;gt;&quot;;&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; var hfPrint=document.getElementById(hfPrintClientID);&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; hfPrint.value=print;&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; var hfmaxkeyClientID=&quot;&amp;lt;%=hfmaxkey.ClientID%&amp;gt;&quot;;&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; var hfmaxkey=document.getElementById(hfmaxkeyClientID);&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; hfmaxkey.value=maxkey;&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; var btnRefreshViewClientID=&quot;&amp;lt;%=btnRefreshView.ClientID %&amp;gt;&quot;;&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; var btnRefreshView=document.getElementById(btnRefreshViewClientID);&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; btnRefreshView.click();&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; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot; src=&quot;../Scripts/ModalPopups.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vishuwayachal.blogspot.com/feeds/3199539609929337106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/javascript-yes-no-alert_16.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/3199539609929337106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/3199539609929337106'/><link rel='alternate' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/javascript-yes-no-alert_16.html' title='JAVASCRIPT YES NO ALERT'/><author><name>vishal</name><uri>http://www.blogger.com/profile/02063336886358955477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7858007652891377230.post-2414898545104156146</id><published>2012-01-16T00:14:00.001-08:00</published><updated>2012-01-16T00:14:06.551-08:00</updated><title type='text'>Gridview Add Row</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&amp;nbsp;public void newrow()&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; DataTable dt = new DataTable();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataRow dr = null;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(new DataColumn(&quot;Select&quot;, typeof(string)));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(new DataColumn(&quot;sr_no&quot;, typeof(string)));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(new DataColumn(&quot;Source&quot;, typeof(string)));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(new DataColumn(&quot;Destination&quot;, typeof(string)));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(new DataColumn(&quot;Rate&quot;, typeof(string)));&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dr = dt.NewRow();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dr[&quot;Select&quot;] = string.Empty;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dr[&quot;sr_no&quot;] = string.Empty;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dr[&quot;Source&quot;] = string.Empty;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dr[&quot;Destination&quot;] = string.Empty;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dr[&quot;Rate&quot;] = string.Empty;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Rows.Add(dr);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gridNEW_REC.DataSource = dt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gridNEW_REC.DataBind();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void addnewrow()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; conn.cn.Open();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataTable dt = new DataTable();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataRow dr;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(new DataColumn(&quot;Select&quot;, typeof(string)));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(new DataColumn(&quot;sr_no&quot;, typeof(string)));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(new DataColumn(&quot;Source&quot;, typeof(string)));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(new DataColumn(&quot;Destination&quot;, typeof(string)));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(new DataColumn(&quot;Rate&quot;, typeof(string)));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (gridNEW_REC.Rows.Count &amp;gt; 0)&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; gridNEW_REC.Rows.Count; 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; {&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; dr = dt.NewRow();&lt;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; TextBox t1 = (TextBox)gridNEW_REC.Rows[i].Cells[1].FindControl(&quot;txtno&quot;);&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; dr[1] = Convert.ToString(t1.Text);&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; TextBox t2 = (TextBox)gridNEW_REC.Rows[i].Cells[2].FindControl(&quot;txtSOURCE_STATION&quot;);&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; dr[2] = Convert.ToString(t2.Text);&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; TextBox t3 = (TextBox)gridNEW_REC.Rows[i].Cells[4].FindControl(&quot;txtDEST_STATION&quot;);&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; dr[3] = Convert.ToString(t3.Text);&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; TextBox t4 = (TextBox)gridNEW_REC.Rows[i].Cells[6].FindControl(&quot;txtRATE&quot;);&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; dr[4] = Convert.ToString(t4.Text);&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; dt.Rows.Add(dr);&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; }&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; dr = dt.NewRow();&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; dt.Rows.Add(dr);&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; gridNEW_REC.DataSource = dt;&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; gridNEW_REC.DataBind();&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; auto_gen_grid_no();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vishuwayachal.blogspot.com/feeds/2414898545104156146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/gridview-add-row.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/2414898545104156146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/2414898545104156146'/><link rel='alternate' type='text/html' href='http://vishuwayachal.blogspot.com/2012/01/gridview-add-row.html' title='Gridview Add Row'/><author><name>vishal</name><uri>http://www.blogger.com/profile/02063336886358955477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7858007652891377230.post-972873177509963462</id><published>2011-08-22T23:04:00.000-07:00</published><updated>2011-08-22T23:05:51.821-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Samsumg Star Wallpaper"/><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnOoxJInpywIf1fmPaTA_WsmBDN-oJM3Ya0gV6o7mPVhqSSXM7ccoD0jyO4QkRgABwFKKcoo49iYeJjmpJKHflydvDsIbL0q9xx7eIYixEoZ4p7Yyr8Y65JmzC6R_V3ZhmeSFwQvlypMeR/s1600/Deepika_Pdukone.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnOoxJInpywIf1fmPaTA_WsmBDN-oJM3Ya0gV6o7mPVhqSSXM7ccoD0jyO4QkRgABwFKKcoo49iYeJjmpJKHflydvDsIbL0q9xx7eIYixEoZ4p7Yyr8Y65JmzC6R_V3ZhmeSFwQvlypMeR/s320/Deepika_Pdukone.jpg&quot; width=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtHfN_Sv6h82YaWhYx6l_M5PNWlNfssJuYC_EM0FPKVw0rpnUdIkz-LQhsxKDrXqXkzHOKCXSBQuve4QUKt2qVwiiETJ91WLy9BiCCeGZLkQMHIaX0acGvevxUkTIbJ-RGS53dvyuCMRC2/s1600/2948.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtHfN_Sv6h82YaWhYx6l_M5PNWlNfssJuYC_EM0FPKVw0rpnUdIkz-LQhsxKDrXqXkzHOKCXSBQuve4QUKt2qVwiiETJ91WLy9BiCCeGZLkQMHIaX0acGvevxUkTIbJ-RGS53dvyuCMRC2/s320/2948.jpg&quot; width=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw6V14U7IWUos-52KEmAUvZX5MhCIryePv3y67f1y9CQ7yGZQ9Usc-M9-pD0OmP1J61bF1-LXl3uU9NmXGY-A20Q9EwCW9xHTzp4wlhzlzIaMY6l9aTzo2X_AmNautX8-taULa9TLfnzCT/s1600/Anjana.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw6V14U7IWUos-52KEmAUvZX5MhCIryePv3y67f1y9CQ7yGZQ9Usc-M9-pD0OmP1J61bF1-LXl3uU9NmXGY-A20Q9EwCW9xHTzp4wlhzlzIaMY6l9aTzo2X_AmNautX8-taULa9TLfnzCT/s320/Anjana.jpg&quot; width=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWYhHtmGo_ktbKJHqE20mYHEFicT4VcnZTDhL4-Ep-KHSvpR8nBAKV_rk_rddfBKh1EbLga9a4h33s3uBR8Jn473PyMgtAFGbuoIb0BmWaBP1dm_W_3JjwnRq8TKp7r3d34VzGaB5GqH1U/s1600/Anushka_Sharma.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWYhHtmGo_ktbKJHqE20mYHEFicT4VcnZTDhL4-Ep-KHSvpR8nBAKV_rk_rddfBKh1EbLga9a4h33s3uBR8Jn473PyMgtAFGbuoIb0BmWaBP1dm_W_3JjwnRq8TKp7r3d34VzGaB5GqH1U/s1600/Anushka_Sharma.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCcyGAYeKI3VBihoyk-UuuHRcwbxzVEiXm4jOn84vf-o_YpFRimXfnBOm8EWgRLf7sm1y9UB1G_9nEfRBpw7Mrcg1KjnMvei0oy9G-kUF75RVXwakI-185rG283vNBgD16Y7lCOY4sKm0h/s1600/Anushka_Sharma%25282%2529.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCcyGAYeKI3VBihoyk-UuuHRcwbxzVEiXm4jOn84vf-o_YpFRimXfnBOm8EWgRLf7sm1y9UB1G_9nEfRBpw7Mrcg1KjnMvei0oy9G-kUF75RVXwakI-185rG283vNBgD16Y7lCOY4sKm0h/s1600/Anushka_Sharma%25282%2529.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtmPSVCAAtcd313F4juI6IkU5ywRD434av0aOdJA9am515XrzMD87Nvhfkingg91ULD-SBst1Ve8SnA3ADJoaRwq5yKeQGMzEFvQH2LEcC8s3V2ZKvquhrONk_M1UFR6lcizIIE4LUbWPo/s1600/Beautiful_Life.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtmPSVCAAtcd313F4juI6IkU5ywRD434av0aOdJA9am515XrzMD87Nvhfkingg91ULD-SBst1Ve8SnA3ADJoaRwq5yKeQGMzEFvQH2LEcC8s3V2ZKvquhrONk_M1UFR6lcizIIE4LUbWPo/s1600/Beautiful_Life.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkBGucJ-F37LbXuxRFNqhMHTz-hUt5F81uYXo_krOxSYAk-YetQv9WxQiuICmbTiFUj4JmnIHCCtDAwPc3BkSRuGEzU5e_iXjrMU7PsM3Z2-zZoa2ljp4OSAJiqzrqquiwZumHWK5rK_Tw/s1600/Beauty.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkBGucJ-F37LbXuxRFNqhMHTz-hUt5F81uYXo_krOxSYAk-YetQv9WxQiuICmbTiFUj4JmnIHCCtDAwPc3BkSRuGEzU5e_iXjrMU7PsM3Z2-zZoa2ljp4OSAJiqzrqquiwZumHWK5rK_Tw/s1600/Beauty.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqqlmAZwK3NdLfBb4Q82pRgWe7ED0-JTV7iTSdTD82ZBNcc_G5m3tAk4OVeXd2cAAtS6hmup21zXRwKEk8Z9CUYJ2Y825qu7tYhBev9C9suZGlHheGypqvR1ebHJitkdKgidP5sIe2cPcI/s1600/Break_The_Rules.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqqlmAZwK3NdLfBb4Q82pRgWe7ED0-JTV7iTSdTD82ZBNcc_G5m3tAk4OVeXd2cAAtS6hmup21zXRwKEk8Z9CUYJ2Y825qu7tYhBev9C9suZGlHheGypqvR1ebHJitkdKgidP5sIe2cPcI/s1600/Break_The_Rules.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq0KnwEcVVQn2bXaj9sqCxU6DyLEs_oi9Nxu0enW6ZFroNBXTy-VWJBBapbMYwk__zBTEnrfqyKaGmU90CjChvkKDHc-D-7NdXWb7LS8jPH57i3Mb0kHt-BAxUz_g1y3xhC_YFg212SSKM/s1600/Cuite_Girl.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq0KnwEcVVQn2bXaj9sqCxU6DyLEs_oi9Nxu0enW6ZFroNBXTy-VWJBBapbMYwk__zBTEnrfqyKaGmU90CjChvkKDHc-D-7NdXWb7LS8jPH57i3Mb0kHt-BAxUz_g1y3xhC_YFg212SSKM/s320/Cuite_Girl.jpg&quot; width=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfVcH4M74Ba3dqm0H1wDiGinupsuSg-zYFvEo48dsZUuUzRBGBZY7dpR-3MEutFCKtwLwM-SLUACLH19AfUAUYbte2Tg_zEfVDzaBb1M13uUh759Vo2f5dxURs7eJXWR20UD0yP3v-64Qi/s1600/Cute_Desi_Girl.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfVcH4M74Ba3dqm0H1wDiGinupsuSg-zYFvEo48dsZUuUzRBGBZY7dpR-3MEutFCKtwLwM-SLUACLH19AfUAUYbte2Tg_zEfVDzaBb1M13uUh759Vo2f5dxURs7eJXWR20UD0yP3v-64Qi/s320/Cute_Desi_Girl.jpg&quot; width=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX359wHBOlQpZaJN5OAVOLn5LJzKquPD_5ulz1MEXwTu2Ec8Ph6ft03iiivsDSkzvM-qrELDXOCH9mHY9PdxN90SUUYecokDXjk_fxobybyZ50AMzeIbpamtL3oC46Bo5lKi1Odq7aWRM-/s1600/Cute_Girl.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX359wHBOlQpZaJN5OAVOLn5LJzKquPD_5ulz1MEXwTu2Ec8Ph6ft03iiivsDSkzvM-qrELDXOCH9mHY9PdxN90SUUYecokDXjk_fxobybyZ50AMzeIbpamtL3oC46Bo5lKi1Odq7aWRM-/s1600/Cute_Girl.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisbBwjE88vvzi_HUkU-uQLokf9o6vyUI6J7Jgz4CmnTung8NPfMUXnft3VxQjPc7ibv_5eMQSI6kI3rH9RmMkwv0jdoMZBK4ynU_fHZfXMJrg31a_kT72U7McJMd4s-k-6NcmUi0ktI9gY/s1600/Cute_Girl_Kriti.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisbBwjE88vvzi_HUkU-uQLokf9o6vyUI6J7Jgz4CmnTung8NPfMUXnft3VxQjPc7ibv_5eMQSI6kI3rH9RmMkwv0jdoMZBK4ynU_fHZfXMJrg31a_kT72U7McJMd4s-k-6NcmUi0ktI9gY/s1600/Cute_Girl_Kriti.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZtrxXspY6LuiIeoUH6RIOK5EOGnwY2yF9jA8mWBbqX00RIgswAVfEuU5zjCmi0yJFF37EFSLWSfg5yUTajmuyDYMAJjylRMjfA_M3Z0yr8fXtSKUnnkhpOG6ODzoaTW-0xeq3w4cP7h/s1600/Cute_Indian_Girl.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZtrxXspY6LuiIeoUH6RIOK5EOGnwY2yF9jA8mWBbqX00RIgswAVfEuU5zjCmi0yJFF37EFSLWSfg5yUTajmuyDYMAJjylRMjfA_M3Z0yr8fXtSKUnnkhpOG6ODzoaTW-0xeq3w4cP7h/s320/Cute_Indian_Girl.jpg&quot; width=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDVkCKlByo9iCruDCh1pf86KhrW15MHrmZurraINSLxXLNBVtrKOGZRV9y23fNhPaYrKA8uFxLuOA1CRkwQUpI8w_x8e5slloCEm_lZtMNpWnuk6Bz_EkKo8H14W4vLa_7HYfWpPPg_XlB/s1600/Dabangg.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDVkCKlByo9iCruDCh1pf86KhrW15MHrmZurraINSLxXLNBVtrKOGZRV9y23fNhPaYrKA8uFxLuOA1CRkwQUpI8w_x8e5slloCEm_lZtMNpWnuk6Bz_EkKo8H14W4vLa_7HYfWpPPg_XlB/s320/Dabangg.jpg&quot; width=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vishuwayachal.blogspot.com/feeds/972873177509963462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vishuwayachal.blogspot.com/2011/08/blog-post_22.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/972873177509963462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7858007652891377230/posts/default/972873177509963462'/><link rel='alternate' type='text/html' href='http://vishuwayachal.blogspot.com/2011/08/blog-post_22.html' title=''/><author><name>vishal</name><uri>http://www.blogger.com/profile/02063336886358955477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnOoxJInpywIf1fmPaTA_WsmBDN-oJM3Ya0gV6o7mPVhqSSXM7ccoD0jyO4QkRgABwFKKcoo49iYeJjmpJKHflydvDsIbL0q9xx7eIYixEoZ4p7Yyr8Y65JmzC6R_V3ZhmeSFwQvlypMeR/s72-c/Deepika_Pdukone.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Kolhapur, Maharashtra, India</georss:featurename><georss:point>16.7 74.233299999999986</georss:point><georss:box>16.6570645 74.18068599999998 16.742935499999998 74.285913999999991</georss:box></entry></feed>