<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>All1 Source technologies &#187; ajax</title>
	<atom:link href="http://www.all1sourcetech.com/tag/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.all1sourcetech.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 23 Nov 2011 12:26:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Inside JSF 2.0&#8217;s Ajax and HTTP GET Support</title>
		<link>http://www.all1sourcetech.com/jsf-20s-ajax-http-support/</link>
		<comments>http://www.all1sourcetech.com/jsf-20s-ajax-http-support/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 11:46:31 +0000</pubDate>
		<dc:creator>Naggie</dc:creator>
				<category><![CDATA[Expert's Opinions]]></category>
		<category><![CDATA[Purely Technical]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[http support]]></category>
		<category><![CDATA[Java Web framework]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JSF 2.0's Ajax]]></category>
		<category><![CDATA[onlinequiz]]></category>

		<guid isPermaLink="false">http://www.all1sourcetech.com/?p=1043</guid>
		<description><![CDATA[With support for these techniques, this newest version of the Java component UI framework enables developers to build truly dynamic web pages simply and easily.
At the highest level, JSF technology provides an API for creating, managing, and handling UI components and a tag library for using components within a web page. The JSF 2.0 release [...]]]></description>
			<content:encoded><![CDATA[<p>With support for these techniques, this newest version of the Java component UI framework enables developers to build truly dynamic web pages simply and easily.</p>
<p>At the highest level, <a href="http://www.all1martpro.com" target="_blank">JSF technology</a> provides an API for creating, managing, and handling UI components and a tag library for using components within a web page. The JSF 2.0 release simplifies the web developer&#8217;s life by providing the following:</p>
<ul>
<li>Reusable UI components for easy authoring of web pages</li>
<li>Well defined and simple transfer of application data to and from the UI</li>
<li>Easy state management across server requests</li>
<li>Simplified event handling model</li>
<li>Easy creation of custom UI components</li>
</ul>
<p>For GET requests and Ajax integration, we need to drill down into JSF 2.0’s support, as well as the productive features that this support makes possible. The demo application is an online quiz that allows a registered user to answer five simple questions that test his or her general knowledge. Towards the end of the quiz, the application displays the score.</p>
<p><strong>Using GET Requests in JSF 2.0</strong></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">To support GET requests, JSF 2.0 introduced the concept of View Parameters. View Parameters provide a way to attach query parameters to URLs. You use the tag &lt;f:viewParam&gt; to specify the query parameters.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Take this code for example:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;f:metadata&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;f:viewParam name=&#8221;previousScore&#8221; value=&#8221;#{recordBean.oldScore}&#8221; /&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;/f:metadata&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">In this example, the value of the parameter previousScore will be automatically picked up and pushed into the property oldScore of the recordBean. So, when a request like this comes for a URL:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 247px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">displayData.jspx?previousScore=10</div>
<p>To support GET requests, JSF 2.0 introduced the concept of View Parameters. View Parameters provide a way to attach query parameters to URLs. You use the tag <strong>&lt;f:viewParam&gt;</strong> to specify the query parameters.</p>
<p><strong>Take this code for example:</strong></p>
<p><span style="color: #008000;">&lt;f:metadata&gt;</span></p>
<p><span style="color: #008000;">&lt;f:viewParam name=&#8221;previousScore&#8221; value=&#8221;#{recordBean.oldScore}&#8221; /&gt;</span></p>
<p><span style="color: #008000;">&lt;/f:metadata&gt;</span></p>
<p>In this example, the value of the parameter previousScore will be automatically picked up and pushed into the property oldScore of the recordBean. So, when a request like this comes for a URL:</p>
<p><strong>displayData.jspx?previousScore=10</strong></p>
<p>The value of the bean property oldScore will be set to 10 when the request is processed, which avoids manually setting the value or using a listener. Another interesting point to notice is that like any other component the  tag <strong>&lt;f:viewParam&gt;</strong> supports conversion and validation. Hence, there is no need for separate conversion/validation logic.</p>
<p><strong>The new tags in JSF 2.0 related to support for the GETrequest.</strong></p>
<p><strong>h:button</strong> :- Renders a button that generates a GET request without any handcoding of URLs</p>
<p><strong>h:link</strong> :- Renders a link that generates a GET request without any handcoding of URLs</p>
<p><strong>h:outputStylesheet</strong> :- Refers to a CSS resource</p>
<p><strong>h:outputScript</strong> :- Refers to a JavaScript resource</p>
<p><strong>f:event</strong> :- Registers a specification-defined or a user-defined event</p>
<p><strong>f:ajax</strong> :- Enables associated component(s) to make Ajax calls</p>
<p><strong>f:metadata</strong> :- Declares the metadata facet for this view</p>
<p><strong>f:viewParam</strong> :- Used in  to define a view parameter that associates a request parameter to a model property</p>
<p><strong>f:validateBean</strong> :- Delegates the validation of the local value to the Bean Validation API</p>
<p><strong>f:validateRegex</strong> :- Uses the pattern attribute to validate the wrapping component</p>
<p><strong>f:validateRequired</strong> :- Ensures the presence of a value</p>
<p><strong>Bookmarking Support</strong></p>
<p>Because all <a href="http://www.all1social.com" target="_blank">JSF 1.x interactions</a> with the server use only HTTP POST requests, those JSF versions don&#8217;t support bookmarking pages in a web application. Even though some tags supported the construction of URLs, it was a manual process with no support for dynamic URL generation. JSF 2.0&#8217;s support for HTTP GET requests provides the bookmarking capability with the help of new renderer kits.</p>
<p>A new UI component UIOutcomeTarget provides properties that you can use to produce a hyperlink at render time. The component allows bookmarking pages for a button or a link.</p>
<p>The two HTML tags that support bookmarking are h:link and h:button. Both generate URLs based on the outcome property of the component, so that the author of the page no longer has to hard code the destination URL. These components use the JSF navigation model to decide the appropriate destination.</p>
<p><strong>Take the following code for example:</strong></p>
<p><span style="color: #008000;">&lt;h:link outcome=&#8221;login&#8221; value=&#8221;LoginPage&#8221; &gt;</span></p>
<p><span style="color: #008000;">&lt;f:param name=&#8221;Login&#8221; value=&#8221;#{loginBean.uname }&#8221; /&gt;</span></p>
<p><span style="color: #008000;">&lt;/h:link&gt;</span></p>
<p>This bookmarking feature provides an option for pre-emptive navigation (i.e., the navigation is decided at the render response time before the user has activated the component). This pre-emptive navigation is used to convert the logical outcome of the tag into a physical destination. At render time, the <a href="http://www.all1tunes.com" target="_blank">navigation system</a> is consulted to map the outcome to a target view ID, which is then transparently converted into the destination URL. This frees the page author from having to worry about manual URL construction.</p>
<p><strong>Support for Ajax</strong></p>
<p>The default implementation provides a single <a href="http://www.all1press.com" target="_blank">JavaScript resource</a> that has the resource identifier jsf.js. This resource is required for Ajax, and it must be available under the javax.faces library. The annotation@ResourceDependency is used to specify the Ajax resource for the components, the JavaScript function <strong>jsf.ajax.request</strong> is used to send information to the server in an asynchronous way, and the JavaScript function <strong>jsf.ajax.response</strong> is used for sending the information back from the server to the client.</p>
<p>On the client side, the API <strong>jsf.ajax.request</strong> is used to issue an Ajax request. When the response has to be rendered back to the client, the callback previously provided by jsf.ajax.request is invoked. This automatically updates the client-side DOM to reflect the newly rendered markup.</p>
<p><strong>The two ways to send an Ajax request by registering an event callback function are:</strong></p>
<ul>
<li>Use the JavaScript function jsf.ajax.request</li>
<li>Use the <strong>&lt;f:ajax&gt;</strong> tag</li>
</ul>
<p><strong>JavaScript Function jsf.ajax.request</strong></p>
<p>The function <strong>jsf.ajax.request</strong>(source, event, options) is used to send an asynchronous Ajax request to the server. The code snippet below shows how you can use this function:</p>
<p><span style="color: #008000;">&lt;commandButton id=&#8221;newButton&#8221; value=&#8221;submit&#8221;</span></p>
<p><span style="color: #008000;">onclick=&#8221;jsf.ajax.request(this,event,</span></p>
<p><span style="color: #008000;">{execute:&#8217;newButton&#8217;,render:&#8217;status&#8217;,onevent: handleEvent,onerror: handleError});return false;&#8221;/&gt;</span></p>
<p><span style="color: #008000;">&lt;/commandButton/&gt;</span></p>
<p>The first argument in the function represents the DOM element that made an Ajax call, while the second argument (which is optional) corresponds to the DOM event that triggered this request. The third argument is composed of a set of parameters, which is sent mainly to control the client/server processing. The available options are execute, render, onevent, onerror, and params.</p>
<p><strong>&lt;f:ajax&gt; Tag</strong></p>
<p><strong>JSF 2.0</strong> enables page authoring with <strong>&lt;f:ajax&gt;</strong>, which is a declarative approach for making Ajax requests. You can use this tag instead of manually coding the JavaScript for Ajax request calls. This tag serves two roles, depending on the placement. You can nest it within any <strong>HTML component or custom component</strong>. If you nest it with a single component, it will associate an Ajax action with that component.</p>
<p>The <strong>&lt;f:ajax&gt;</strong> <strong>tag </strong>has four important attributes:</p>
<ul>
<li><strong>render </strong>– ID or a space-delimited list of component identifiers that will be updated as a result of the Ajax call</li>
<li><strong>execute </strong>– ID or a space-delimited list of component identifiers that should be executed on the server</li>
<li><strong>event </strong>– The type of event the Ajax action will apply to (refers to a JavaScript event without the on prefix)</li>
<li><strong>onevent </strong>– The JavaScript function to handle the event</li>
</ul>
<p>Consider the following code from the login page of the online quiz application. The code validates the input of the email field by sending an Ajax call for every keystroke. The validation is done by a managed bean method that acts as a value change listener.</p>
<p><span style="color: #008000;">&lt;h:inputText label=&#8221;eMail ID&#8221;   id=&#8221;emailId&#8221; value=&#8221;#{userBean.email}&#8221; size=&#8221;20&#8243;</span></p>
<p><span style="color: #008000;">required=&#8221;true&#8221; valueChangeListener=&#8221;#{userBean.validateEmail}&#8221;&gt;</span></p>
<p><span style="color: #008000;">&lt;f:ajax event=&#8221;keyup&#8221; render=&#8221;emailResult&#8221;/&gt;</span></p>
<p><span style="color: #008000;">&lt;/h:inputText&gt;</span></p>
<p><span style="color: #008000;">&#8230;</span></p>
<p><span style="color: #008000;">&lt;h:outputText id=&#8221; emailResult&#8221; value=&#8221;#{userBean.emailPrompt}&#8221; /&gt;</span></p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.developer.com/img/2010/03/OnlineQuizAjax_Fig1.JPG" alt=" Inside JSF 2.0s Ajax and HTTP GET Support" width="715" height="302" title="Inside JSF 2.0s Ajax and HTTP GET Support" /></p>
<p>Using Ajax to Validate the Input: The online quiz application validates email field input by sending an Ajax call for every keystroke.</p>
<p>Here, <strong>&lt;f:ajax&gt;</strong> is nested within the emailId inputText component. For every keyup event that is generated, an Ajax call is sent to the server, which invokes the valueChangeListener. By default, the component in which the tag is nested is executed on the server. So, the execute attribute is not specified. Also, for an input component, the default event is valueChange, so the event attribute is also not used. The render attribute indicates that the outputText component emailResult should be updated after the Ajax call.</p>
<p>If you place this tag around a group of components, it will associate an Ajax action with all the components that support the events attribute.</p>
<p><span style="color: #008000;">&lt;f:ajax event=&#8221;mouseover&#8221;&gt;</span></p>
<p><span style="color: #008000;">&lt;h:inputText id=&#8221;input1&#8243; &#8230;/&gt;</span></p>
<p><span style="color: #008000;">&lt;h:commandLink id=&#8221;link1&#8243; &#8230;/&gt;</span></p>
<p><span style="color: #008000;">&lt;/f:ajax&gt;</span></p>
<p><strong>In this example, input1 and link1 will exhibit Ajax behavior on a mouseover event.</strong></p>
<p><span style="color: #008000;">&lt;f:ajax event=&#8221;mouseover&#8221;&gt;</span></p>
<p><span style="color: #008000;">&lt;h:inputText id=&#8221;input1&#8243; &#8230;&gt;</span></p>
<p><span style="color: #008000;">&lt;f:ajax event=&#8221;keyup&#8221;/&gt;</span></p>
<p><span style="color: #008000;">&lt;/h:inputText&gt;</span></p>
<p><span style="color: #008000;">&lt;h:commandLink id=&#8221;link1&#8243; &#8230;/&gt;</span></p>
<p><span style="color: #008000;">&lt;/f:ajax&gt;</span></p>
<p>In this example, input1 and link1 exhibit Ajax behavior on keyup and mouseover events, respectively.</p>
<p>Using the Ajax tag enhances the markup of the associated component to include a script that triggers the Ajax request. This the page author to issue Ajax requests without having to write any JavaScript code.</p>
<p>These new features enable developers to build truly dynamic web pages simply and easily.</p>
<p><a href="http://www.developer.com/" target="_blank">http://www.developer.com</a></p>
<p><a href="http://www.all1sourcetech.com" target="_blank">http://www.all1sourcetech.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.all1sourcetech.com/jsf-20s-ajax-http-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Plugin Releases for 03/01</title>
		<link>http://www.all1sourcetech.com/wordpress-plugin-releases-0301/</link>
		<comments>http://www.all1sourcetech.com/wordpress-plugin-releases-0301/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 10:18:17 +0000</pubDate>
		<dc:creator>Suzanne</dc:creator>
				<category><![CDATA[New Product Release]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[cronjobs]]></category>
		<category><![CDATA[flash chat]]></category>
		<category><![CDATA[new plugin]]></category>
		<category><![CDATA[wordpress theme]]></category>

		<guid isPermaLink="false">http://www.all1sourcetech.com/?p=1021</guid>
		<description><![CDATA[All these new wordpress plugins releases this month as follows: 
123 Flash Chat- This new plugin can be used to create your own chat room in WordPress. It allows you to insert chat room to your sidebar, with either a light chat client or a link to standard chat client in popup mod. And you [...]]]></description>
			<content:encoded><![CDATA[<p>All these new wordpress plugins releases this month as follows: </p>
<p><strong>123 Flash Chat</strong>- This new plugin can be used to <a href="http://www.all1martpro.com" target="_blank">create your own chat room</a> in WordPress. It allows you to insert chat room to your sidebar, with either a light chat client or a link to standard chat client in popup mod. And you can define the width and height of 123 Flash Chat as well as its skin &#038; language. The chat room displays a “hosted by 123flashchat.com free of charge” message.</p>
<p><strong>Asynchronous Widgets</strong>- It allows you to have any registered widget on your WordPress.org-powered site be loaded asynchronously via an <a href="http://www.all1tunes.com" target="_blank">AJAX</a> call.</p>
<p><strong>WP-Tabbity</strong>- WP-Tabbity allows authors to create one or more tab groups containing one or more tabs, animated by the WordPress-included<br />
<a href="http://www.all1press.com" target="_blank">version of jQuery</a>.</p>
<p><strong>WP Function Reference</strong>- It provides a box on the dashboard with a list of the functions that are available for you to use in your <a href="http://www.all1social.com" target="_blank">Wordpress</a> installation.</p>
<p><strong>Disable WordPress Updates</strong>- Disables the theme; plugin and core update checking, the related cronjobs and notification system.</p>
<p><a href="http://www.all1martpro.com" target="_blank">http://www.all1martpro.com</a></p>
<p><a href="http://get-a-designer.com/" target="_blank">http://get-a-designer.com</a>	</p>
]]></content:encoded>
			<wfw:commentRss>http://www.all1sourcetech.com/wordpress-plugin-releases-0301/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4 Steps to Consume Web Services using Ajax</title>
		<link>http://www.all1sourcetech.com/4-steps-consume-web-services-ajax/</link>
		<comments>http://www.all1sourcetech.com/4-steps-consume-web-services-ajax/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 11:20:14 +0000</pubDate>
		<dc:creator>Naggie</dc:creator>
				<category><![CDATA[Microsoft Technology]]></category>
		<category><![CDATA[Purely Technical]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[ASP developers]]></category>
		<category><![CDATA[ASP framework]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET code]]></category>
		<category><![CDATA[customer ID]]></category>

		<guid isPermaLink="false">http://www.all1sourcetech.com/?p=1001</guid>
		<description><![CDATA[Normally the browser Ajax controls calls the ASP.NET code and the ASP.NET code consumes the web service, but there are scenarios where you would like to call the web services directly from the Ajax JavaScript functions rather than calling via the behind code.
Here, you can get the same following 4 steps-
Step 1: Create your Customer [...]]]></description>
			<content:encoded><![CDATA[<p>Normally the <strong>browser Ajax</strong> controls calls the <a href="http://www.all1martpro.com" target="_blank">ASP.NET code</a> and the ASP.NET code consumes the web service, but there are scenarios where you would like to call the web services directly from the Ajax <a href="http://www.all1tunes.com" target="_blank">JavaScript</a> functions rather than calling via the behind code.</p>
<p>Here, you can get the same following 4 steps-</p>
<p><strong>Step 1: <span style="color: #800000;">Create your Customer Class </span></strong></p>
<p>The first step is to create the <a href="http://www.all1press.com" target="_blank">customer</a> class as shown below. So the customer class has 4 properties on customer id, first name, address and designation.</p>
<p><span style="color: #0000ff;"><strong>public </strong></span><strong>class Customers</strong><br />
<strong>{</strong><br />
<strong><span style="color: #99cc00;">// private properties </span></strong><br />
<strong>private int _intCustomerID;</strong><br />
<span style="color: #0000ff;"><strong>private string</strong></span><strong> _strFirstName;</strong><br />
<span style="color: #0000ff;"><strong>private string</strong></span><strong> _strAddress;</strong><br />
<span style="color: #0000ff;"><strong>private string</strong></span><strong> _strDesignation;</strong><br />
<strong><br />
</strong></p>
<p><strong><span style="color: #99cc00;">// Public property and</span> </strong><br />
<span style="color: #0000ff;"><strong>public</strong></span><strong> </strong><span style="color: #0000ff;"><strong>int </strong></span><strong>CustomerID</strong><br />
<strong>{</strong><br />
<span style="color: #0000ff;"><strong>get</strong></span><br />
<strong>{</strong><br />
<span style="color: #0000ff;"><strong>return </strong></span><strong>_intCustomerID;</strong><br />
<strong>}</strong><br />
<span style="color: #0000ff;"><strong>set</strong></span><br />
<strong>{</strong><br />
<strong>_intCustomerID = value;</strong><br />
<strong>}</strong><br />
<strong>}</strong><br />
<span style="color: #0000ff;"><strong>public string </strong></span><strong>FirstName</strong><br />
<strong>{</strong><br />
<span style="color: #0000ff;"><strong>get</strong></span><br />
<strong>{</strong><br />
<span style="color: #0000ff;"><strong>return </strong></span><strong>_strFirstName;</strong><br />
<strong>}</strong><br />
<span style="color: #0000ff;"><strong>set</strong></span><br />
<strong>{</strong><br />
<strong>_strFirstName = value;</strong><br />
<strong>}</strong><br />
<strong>}</strong></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">public class Customers</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">// private properties</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">private int _intCustomerID;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">private string _strFirstName;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">private string _strAddress;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">private string _strDesignation;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">// Public property and</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">public int CustomerID</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">get</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">return _intCustomerID;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">set</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">_intCustomerID = value;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">public string FirstName</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">get</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">return _strFirstName;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">set</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">_strFirstName = value;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 770px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<p><strong>Step 2: <span style="color: #800000;">Create your Web Service</span></strong></p>
<p>The next step is to create the web service which exposes the customer class to UI. Here is a simple web service which has encapsulated customer collection. In the constructor, we are loading some dummy data into the list of customers as shown in the below code snippet:</p>
<p><strong>   [System.Web.Script.Services.ScriptService]</strong><br />
<strong><span style="color: #0000ff;">public class </span>Customer : System.Web.Services.WebService {</strong></p>
<p><strong><span style="color: #99cc00;">// Customer collection</span></strong><br />
<strong>List&lt;Customers&gt; listcust = <span style="color: #0000ff;">new </span>List&lt;Customers&gt;();</strong><br />
<strong><span style="color: #0000ff;">public </span>Customer () </strong><br />
<strong>{</strong><br />
<strong><span style="color: #99cc00;">//Load some dummy data in to customer collection.</span></strong><br />
<strong>listcust.Clear();</strong></p>
<p><strong>Customers cust = <span style="color: #0000ff;">new </span>Customers();</strong><br />
<strong>cust.CustomerID = 1;</strong><br />
<strong>cust.FirstName = &#8220;Dan&#8221;;</strong><br />
<strong>cust.Address = &#8220;Live in UK&#8221;;</strong><br />
<strong>cust.Designation = &#8220;Software Developer&#8221;;</strong><br />
<strong>listcust.Add(cust);</strong></p>
<p><strong>cust = <span style="color: #0000ff;">new </span>Customers();</strong><br />
<strong>cust.CustomerID = 2;</strong><br />
<strong>cust.FirstName = &#8220;Sheen&#8221;;</strong><br />
<strong>cust.Address = &#8220;Live in Austrailia&#8221;;</strong><br />
<strong>cust.Designation = &#8220;Web Designer&#8221;;</strong><br />
<strong>listcust.Add(cust);</strong></p>
<p><strong>cust = <span style="color: #0000ff;">new </span>Customers();</strong><br />
<strong>cust.CustomerID = 3;</strong><br />
<strong>cust.FirstName = &#8220;Koraine&#8221;;</strong><br />
<strong>cust.Address = &#8220;Live in London&#8221;;</strong><br />
<strong>cust.Designation = &#8220;Architect&#8221;;</strong><br />
<strong>listcust.Add(cust);</strong><br />
<strong>}</strong></p>
<p><strong><span style="color: #99cc00;">// This function exposes all customers to the end client’</span></strong><br />
<strong>[WebMethod]</strong><br />
<strong><span style="color: #0000ff;">public </span>List&lt;Customers&gt; LoadCustomers()</strong><br />
<strong>{</strong><br />
<strong><span style="color: #0000ff;">return </span>listcust;</strong><br />
<strong>}</strong></p>
<p><strong><span style="color: #99cc00;">// This function helps us to get customer object based in ID</span></strong><br />
<strong>[WebMethod]</strong><br />
<strong><span style="color: #0000ff;">public </span>Customers LoadSingleCustomers(<span style="color: #0000ff;">int </span>_customerid)</strong><br />
<strong>{</strong><br />
<strong><span style="color: #0000ff;">return </span>(Customers)listcust[_customerid-1];</strong><br />
<strong>}</strong></p>
<p>Two functions have been exposed with the web service, one which gives out a list of customers and another which gives out individual customer data based on customer id.</p>
<p><strong>Step 3: <span style="color: #800000;">Reference your Web Service using the asp:servicereference</span></strong></p>
<p>Using the ‘<span style="color: #ff0000;">asp:ServiceReference</span>’, the path to the ASMX file will be pointed as shown in the below code snippet. This will generate the <a href="http://www.all1social.com" target="_blank">JavaScript proxy</a> which can be used to call the customer object.</p>
<pre><strong>&lt;asp:ScriptManager <span style="color: #ff0000;">ID</span>="<span style="color: #0000ff;">ScriptManager1</span>" <span style="color: #ff0000;">runat</span>="<span style="color: #0000ff;">server</span>"&gt;</strong></pre>
<pre><strong>    &lt;Services&gt;</strong></pre>
<pre><strong>        &lt;asp:ServiceReference <span style="color: #ff0000;">Path</span>="<span style="color: #0000ff;">Customer.asmx</span>" /&gt;</strong></pre>
<pre><strong>    &lt;/Services&gt;</strong></pre>
<pre><strong>&lt;/asp:ScriptManager&gt;</strong></pre>
<p><strong>Step 4: <span style="color: #800000;">Call the Webservice and the JavaScript Code</span></strong></p>
<p>Once you have defined the proxy, you can now call the ‘Customer’ proxy directly to make method calls.</p>
<p><strong>function LoadAll() </strong><br />
<strong>{</strong><br />
<strong>Customer.LoadCustomers(LoadCustomerToSelectOption, ErrorHandler, TimeOutHandler);</strong><br />
<strong>}</strong></p>
<p>When you call the JavaScript proxy object, then you need to provide three functions; the first function (‘LoadCustomerToSelectOption’) will be called when the web service finishes and returns data. The data will be returned in the fill variable which will then be looped and added to the customer combo box.</p>
<p><strong>function LoadCustomerToSelectOption(Fill)</strong><br />
<strong>{</strong><br />
<strong><span style="color: #0000ff;">var </span>select = document.getElementById(&#8221;<span style="color: #800000;">cmbCustomers</span>&#8220;);</strong><br />
<strong><br />
</strong></p>
<p><strong><span style="color: #0000ff;">for </span>(<span style="color: #0000ff;">var </span>i = 0; i &lt; Fill.length; i++) </strong><br />
<strong>{</strong><br />
<strong><span style="color: #0000ff;">var </span>value = <span style="color: #0000ff;">new </span>Option(Fill[i].FirstName, Fill[i].CustomerID);</strong><br />
<strong>select.options.add(value);</strong><br />
<strong>}</strong><br />
<strong>}</strong></p>
<p>There are two more functions which are attached; one which handles error and the other which handles time out.</p>
<p><strong>function ErrorHandler(result) </strong><br />
<strong>{</strong><br />
<strong><span style="color: #0000ff;">var </span>msg = result.get_exceptionType() + &#8220;<span style="color: #800000;">\r\n</span>&#8220;;</strong><br />
<strong>msg += result.get_message() + &#8220;<span style="color: #800000;">\r\n</span>&#8220;;</strong><br />
<strong>msg += result.get_stackTrace();</strong><br />
<strong>alert(msg);</strong><br />
<strong>}</strong><br />
<strong>function TimeOutHandler(result) </strong><br />
<strong>{</strong><br />
<strong>alert(&#8221;<span style="color: #800000;">Timeout </span>:&#8221; + result);</strong><br />
<strong>}</strong></p>
<p><a href="http://www.all1martpro.com" target="_blank">http://www.all1martpro.com</a><br />
<a href="http://get-a-designer.com/" target="_blank">http://get-a-designer.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.all1sourcetech.com/4-steps-consume-web-services-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postback Text Processing with the AJAX Modal Dialog</title>
		<link>http://www.all1sourcetech.com/postback-text-processing-ajax-modal-dialog/</link>
		<comments>http://www.all1sourcetech.com/postback-text-processing-ajax-modal-dialog/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 06:28:36 +0000</pubDate>
		<dc:creator>Suzanne</dc:creator>
				<category><![CDATA[Microsoft Technology]]></category>
		<category><![CDATA[Purely Technical]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[AJAX Editor Control]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ModalPopup control]]></category>
		<category><![CDATA[ModalPopupExtender]]></category>
		<category><![CDATA[Text Processing]]></category>

		<guid isPermaLink="false">http://www.all1sourcetech.com/?p=932</guid>
		<description><![CDATA[In this case the developer wanted to use an AJAX Editor Control inside a ModalPopup control.
This isn’t a problem but, the user needed to clicking the OK button to cause a post-back so that he could execute some server –side logic.
The ”Ok” Button is an ASP.NET control but adding a Click Event Handler for the [...]]]></description>
			<content:encoded><![CDATA[<p>In this case the developer wanted to use an <a title="AJAX Editor Control" href="http://www.all1social.com" target="_blank">AJAX Editor Control </a>inside a ModalPopup control.</p>
<p>This isn’t a problem but, the user needed to clicking the OK button to cause a post-back so that he could execute some server –side logic.</p>
<p>The ”Ok” Button is an <a title="ASP.NET " href="http://www.all1social.com" target="_blank">ASP.NET </a>control but adding a Click Event Handler for the button didn’t solve the problem because it didn’t get executed when the use Clicked on the “Ok” button.</p>
<p>Normally the ModalPopupExtender would be used like this.</p>
<pre>    <strong>&lt;ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server"</strong></pre>
<pre><strong>                 TargetControlID="LinkButton1"</strong></pre>
<pre><strong>                 PopupControlID="Panel1"</strong></pre>
<pre><strong>                 BackgroundCssClass="modalBackground"</strong></pre>
<pre><strong>                 DropShadow="true"</strong></pre>
<pre><strong>     1.)         OkControlID="OkButton"</strong></pre>
<pre><strong>     2.)         OnOkScript="onOk()"</strong></pre>
<pre><strong>                 CancelControlID="CancelButton" /&gt;</strong></pre>
<p>Line number 1 tells the control to catch the click event for the Ok Button Control instance and line 2 specifies when CLIENT SIDE JavaScript code to execute when the control specifies in line 1 is clicked.</p>
<p>The post-back doesn’t happen (even if the ASP.NET Button control has a click event handler defined in code behind because the control doesn’t propagate it.)</p>
<p>So <span style="color: #993366;"><strong>Just delete those two lines</strong> !</span></p>
<p>It turns out that they are optional and if you delete them the click event is not trapped and the code behind will execute as expected.</p>
<p>So just nake it look like this:</p>
<pre>    <strong>&lt;ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server"</strong></pre>
<pre><strong>                 TargetControlID="LinkButton1"</strong></pre>
<pre><strong>                 PopupControlID="Panel1"</strong></pre>
<pre><strong>                 BackgroundCssClass="modalBackground"</strong></pre>
<pre><strong>                 DropShadow="true"</strong></pre>
<pre><strong>                 CancelControlID="CancelButton" /&gt;</strong></pre>
<p><a href="http://www.all1sourcetech.com" target="_blank">http://www.all1sourcetech.com</a></p>
<p><a href="http://www.all1martpro.com" target="_blank">http://www.all1martpro.com</a></p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
]]></content:encoded>
			<wfw:commentRss>http://www.all1sourcetech.com/postback-text-processing-ajax-modal-dialog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2010 clean application level web.config</title>
		<link>http://www.all1sourcetech.com/visual-studio-2010-clean-application-level-webconfig/</link>
		<comments>http://www.all1sourcetech.com/visual-studio-2010-clean-application-level-webconfig/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 11:52:28 +0000</pubDate>
		<dc:creator>Naggie</dc:creator>
				<category><![CDATA[Microsoft Technology]]></category>
		<category><![CDATA[Purely Technical]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[asp.net chart control]]></category>
		<category><![CDATA[asp.net technology]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[web application]]></category>
		<category><![CDATA[web.config]]></category>

		<guid isPermaLink="false">http://www.all1sourcetech.com/?p=906</guid>
		<description><![CDATA[Introducing new small improvement that has been made in Visual Studio 2010 &#38; .NET 4 to reduce the size of the ASP.NET application level web.config 3.0 and 3.5 web.config
As ASP.NET technology evolved, the application level Web.config had new things added to it. Since the earlier frameworks were using the same set of machine level configuration [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introducing new small improvement</strong> that has been made in Visual Studio 2010 &amp; .NET 4 to reduce the size of the <strong>ASP.NET application</strong> level web.config 3.0 and 3.5 web.config</p>
<p>As <a href="http://www.all1Press.com" target="_blank">ASP.NET technology</a> evolved, the application level Web.config had new things added to it. Since the earlier frameworks were using the same set of machine level configuration files, incremental feature that was added subsequent to the 2.0 release resulted in additional config settings included in the file.<br />
.NET 4 web.config</p>
<p>With .NET 4, the web.config is tremendously reduced in size to improve the simplicity  of ASP.NET</p>
<p>The config settings have been moved down to the machine config file. This includes registers all of the ASP.NET tag sections, handlers, modules and settings for the following:<br />
•	ASP.NET AJAX<br />
•	ASP.NET Dynamic Data<br />
•	ASP.NET Routing<br />
•	ASP.NET Chart Control</p>
<p>You can look at the trimmed down web.config by creating a .Net 4 &#8216;ASP.NET Empty Web Application&#8217; in <a href="http://www.all1martpro.com" target="_blank">Visual Studio 2010</a>.</p>
<p>Following is the web.config file for .NET 4 C# &#8216;ASP.NET Empty Web Application&#8217;:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://blogs.msdn.com/blogfiles/webdevtools/WindowsLiveWriter/VisualStudio2010cleanweb.config_13513/image_thumb.png" alt="image thumb Visual Studio 2010 clean application level web.config" width="644" height="229" title="Visual Studio 2010 clean application level web.config" /></p>
<p>The config file above has settings to tell ASP.NET to enable debugging by default for the application and provides the version of .NET framework to use.</p>
<p><a href="http://www.all1tunes.com" target="_blank">http://www.all1tunes.com</a></p>
<p><a href="http://www.all1social.com" target="_blank">http://www.all1social.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.all1sourcetech.com/visual-studio-2010-clean-application-level-webconfig/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

