<?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/"
	>

<channel>
	<title>ClientSideAsp.Net</title>
	<atom:link href="http://www.clientsideasp.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.clientsideasp.net</link>
	<description>Asp.Net development..</description>
	<pubDate>Mon, 29 Jun 2009 17:54:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Why do you want a better data paging method with Asp.Net</title>
		<link>http://www.clientsideasp.net/2009/06/29/why-do-you-want-a-better-data-paging-method-with-aspnet/</link>
		<comments>http://www.clientsideasp.net/2009/06/29/why-do-you-want-a-better-data-paging-method-with-aspnet/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 20:23:05 +0000</pubDate>
		<dc:creator>Anz</dc:creator>
		
		<category><![CDATA[Asp.Net]]></category>

		<category><![CDATA[Paginations]]></category>

		<category><![CDATA[Asp.net pagination]]></category>

		<category><![CDATA[asp.net pagining]]></category>

		<category><![CDATA[custom numeric pagination]]></category>

		<category><![CDATA[datalist pagination]]></category>

		<category><![CDATA[gridview pagination]]></category>

		<category><![CDATA[repeater pagination]]></category>

		<guid isPermaLink="false">http://www.clientsideasp.net/?p=80</guid>
		<description><![CDATA[<div style="position:relative; width: 100%; padding: 0 0 30px 0;"><div style="position: absolute; bottom: 10px; right:115px; width: 42px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.clientsideasp.net/2009/06/29/why-do-you-want-a-better-data-paging-method-with-aspnet/';
var dzone_title = 'Why do you want a better data paging method with Asp.Net';
var dzone_blurb = 'This is the first of a series of articles am going to write about Asp.Net 2.0 pagination and how to build a custom digg like numeric pagination control...';
var dzone_style = '2';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
This is the first of a series of articles am going to write about Asp.Net 2.0 pagination and how to build a custom digg like numeric pagination control which can be used with DataList, Repeater or any other data bound controls.
NOTE: I haven&#8217;t used the .Net 3.5 DataPager control yet, so am not sure if [...]]]></description>
			<content:encoded><![CDATA[<div style="position:relative; width: 100%; padding: 0 0 30px 0;"><div style="position: absolute; bottom: 10px; right:115px; width: 42px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.clientsideasp.net/2009/06/29/why-do-you-want-a-better-data-paging-method-with-aspnet/';
var dzone_title = 'Why do you want a better data paging method with Asp.Net';
var dzone_blurb = 'This is the first of a series of articles am going to write about Asp.Net 2.0 pagination and how to build a custom digg like numeric pagination control...';
var dzone_style = '2';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p>This is the first of a series of articles am going to write about Asp.Net 2.0 pagination and how to build a custom digg like numeric pagination control which can be used with DataList, Repeater or any other data bound controls.</p>
<p>NOTE: I haven&#8217;t used the .Net 3.5 DataPager control yet, so am not sure if it already addressed the scenarios in the following discussion</p>
<p>The default pagination in Asp.net which comes with GridView is great in terms of developer productivity and ease of use. When use with data source controls it will work without even a single line of code and it is easy to customize by setting simple properties available.</p>
<p>But you may need to think about writing a your own pagination logic when</p>
<ol>
<li>You need pagination with Datalist or Repeater</li>
<li>You need search engine friendly pagination</li>
<li>You need user friendly pagination</li>
<li>You need clean HTML for the pagination links</li>
<li>You need a pagination strip which will work independent of data bound controls</li>
</ol>
<p><span id="more-80"></span></p>
<h2><span style="text-decoration: underline;">1. Pagination with Datalist or Repeater</span></h2>
<p>I like DataList and Repeater more than GridView because of their design flexibility and the control over rendered HTML. See a comparison between Repeater, DataList and GridView here<br />
<a title="Asp.net datalist paging" href="http://www.queensdev.net/Samples/RepeaterDataListGridview.aspx" target="_blank">http://www.queensdev.net/Samples/RepeaterDataListGridview.aspx</a></p>
<p>Repeater and DataList are light and you have the flexibility over the design, but that comes with a price - no pagination. A Google search for “Repeater pagination” will show the huge number of requests and articles on this subject.</p>
<h2><span style="text-decoration: underline;">2. Search engine friendly pagination</span></h2>
<p>This is a major issue with the default Asp.Net pagination. The pagination links in GridView are rendered as JavaScript link buttons, not as HTML hyperlinks. As per SEO guidelines search engines can not understand these kinds of JavaScript links. Search engines will not navigate to the inner pages of a GridView and the page crawling will stop in the first page itself.</p>
<p>By using the default pagination with GridView we are unknowingly restricting the search engine crawlers from accessing our pages. Most of the public facing web sites including asp.net forums and MSDN use search engine friendly links for the pagination.</p>
<h2><span style="text-decoration: underline;">3. User friendly pagination</span></h2>
<p>Yes there are lot of options available to customize the default GridView pagination but the use of three dots (&#8230;) to get the next set of pagination is really confusing. Our users had difficulty in understanding the 3 dots are links and clicking on it will generate the next set of pagination links.</p>
<p>Just see how pagination work in some high profile sites</p>
<h3><span style="text-decoration: underline;">i. Asp.net forums (<a href="http://forums.asp.net" target="_blank">http://forums.asp.net</a>)</span></h3>
<div id="attachment_81" class="wp-caption aligncenter" style="width: 456px"><img class="size-full wp-image-81" title="asp-net-forums paging" src="http://www.clientsideasp.net/wp-content/uploads/2009/06/asp-net-forums.jpg" alt="Pagination in Asp.Net forums" width="446" height="51" /><p class="wp-caption-text">Pagination in Asp.Net forums</p></div>
<p>Go to the Getting Started forum and see the pagination in the bottom. It shows a numeric pagination strip with first 5 page links, link to next &amp; last pages and a description. See the 3 dots (&#8230;) between next and last links; they are not links but simply telling the user that there is lot of pages hidden in between next and last pages.</p>
<p>As we move along the pages, the pagination strip is also getting changed to show the pages near to the current page.</p>
<h3><span style="text-decoration: underline;">ii. Digg</span> ( <a href="http://www.digg.com/" target="_blank">http://www.digg.com/</a> )</h3>
<div id="attachment_82" class="wp-caption aligncenter" style="width: 537px"><img class="size-full wp-image-82" title="digg-pagination" src="http://www.clientsideasp.net/wp-content/uploads/2009/06/digg-pagination.jpg" alt="Pagination in Digg" width="527" height="50" /><p class="wp-caption-text">Pagination in Digg</p></div>
<p>In the home, the pagination strip in digg.com is showing first 10 pages, last two pages and previous next buttons. Go to page 10 and we can see the numeric pagination strip is updated to show the pages near to page 10. The pagination strip is also showing links to move to the first two and last two pages at any time.</p>
<p>MSDN forums also use same kind pagination.</p>
<div id="attachment_83" class="wp-caption aligncenter" style="width: 591px"><img class="size-full wp-image-83" title="msdn-forums" src="http://www.clientsideasp.net/wp-content/uploads/2009/06/msdn-forums.jpg" alt="Pagination in MSDN" width="581" height="51" /><p class="wp-caption-text">Pagination in MSDN</p></div>
<h3><span style="text-decoration: underline;">iii. Default Asp.Net numeric pagination</span> (<a title="Asp.net pagination" href="http://www.clientsideasp.deynu.com/pagination/digg/Asp-net-default-numeric-pagination.aspx" target="_blank">sample page link</a>)<span style="text-decoration: underline;"></p>
<div id="attachment_87" class="wp-caption aligncenter" style="width: 273px"><span style="text-decoration: underline;"><img class="size-full wp-image-87" title="asp-net-gridview-paging" src="http://www.clientsideasp.net/wp-content/uploads/2009/06/asp-net-gridview-paging.jpg" alt="Asp.Net GridView pagination" width="263" height="35" /></span><p class="wp-caption-text">Asp.Net GridView pagination</p></div>
<p></span></h3>
<p>Now analyze how the default Asp.Net numeric pagination works. Go to<a title="Asp.net pagination" href="http://www.clientsideasp.deynu.com/pagination/digg/Asp-net-default-numeric-pagination.aspx" target="_blank"> this page</a> and check the pagination. It shows 10 page links and a link to the last page. Click on page 4, no change in the pagination strip. Click on page 10, no change. I want to go to page 11, what should I do? Oh!! the 3 dots are links to next set of pagination.</p>
<p>Just compare the usability of the above 3 paginations. Definitely the first two paginations are lot easier than the third one. Personally I like the Digg pagination most.</p>
<h2><span style="text-decoration: underline;">4. The rendered HTML is not clean</span></h2>
<p>The pagination strip will render as an inner table to the GridView table with each page links in separate cells. It is not a big issue but why can’t it all be rendered in a single cell without any inner tables?</p>
<h2><span style="text-decoration: underline;">5. Pagination without bound controls</span></h2>
<p>There are situations in which we may need to simply create pagination links based on the total number of items available.<br />
For example, dividing a big article into a number of pages. The current page can be shown in a literal but the links to rest of the pages need to create separately based on the total number of pages.</p>
<h3><span style="text-decoration: underline;">GridView pagination is the best choice for admin part of the site</span></h3>
<p>Because of the 2nd and 3rd points explained above we always try to minimize the use of GridView pagination to the admin side of the site. In the admin side it’s logical to use GridView and default pagination wherever possible because</p>
<ol>
<li>In most cases the admin just want to see the data as a list of items with edit and delete options</li>
<li>The admin may need to sort the data</li>
<li>Admin will be a trained user who can understand the 3 dots are link to next set of pages</li>
<li>The admin side pages are secure and need not come in the search engines</li>
</ol>
<p>That’s all in the first article about asp.net pagination. In next few days I will write next article on how to create a custom Digg like numeric pagination to solve the above issues.</p>
<p>Thanks for reading! Please give feedback and suggestions</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.clientsideasp.net/2009/06/29/why-do-you-want-a-better-data-paging-method-with-aspnet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Showing beautiful message boxes in Asp.Net web forms using JQuery Impromptu</title>
		<link>http://www.clientsideasp.net/2009/06/16/showing-beautiful-message-boxes-in-aspnet-web-forms-using-jquery-impromptu/</link>
		<comments>http://www.clientsideasp.net/2009/06/16/showing-beautiful-message-boxes-in-aspnet-web-forms-using-jquery-impromptu/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 19:47:08 +0000</pubDate>
		<dc:creator>Anz</dc:creator>
		
		<category><![CDATA[Asp.Net]]></category>

		<category><![CDATA[JQuery]]></category>

		<category><![CDATA[Message box]]></category>

		<category><![CDATA[alert]]></category>

		<category><![CDATA[asp.net confirm]]></category>

		<category><![CDATA[asp.net javascript messagebox]]></category>

		<category><![CDATA[asp.net javascript popup]]></category>

		<category><![CDATA[asp.net jquery message box]]></category>

		<category><![CDATA[Asp.net message box]]></category>

		<category><![CDATA[confirm]]></category>

		<guid isPermaLink="false">http://www.clientsideasp.net/?p=64</guid>
		<description><![CDATA[<div style="position:relative; width: 100%; padding: 0 0 30px 0;"><div style="position: absolute; bottom: 10px; right:115px; width: 42px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.clientsideasp.net/2009/06/16/showing-beautiful-message-boxes-in-aspnet-web-forms-using-jquery-impromptu/';
var dzone_title = 'Showing beautiful message boxes in Asp.Net web forms using JQuery Impromptu';
var dzone_blurb = 'Impromptu is an excellent JQuery plug-in to show beautiful message boxes in web forms. Its is easy to use and can be used to make any kind of message boxes...';
var dzone_style = '2';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
Impromptu is an excellent JQuery plug-in to show beautiful message boxes in web forms. Its is easy to use and can be used to make any kind of message boxes such as alerts, confirm boxes, prompts, popup login boxes, popup input wizards etc
From their site
JQuery Impromptu is an extension to help provide a more pleasant [...]]]></description>
			<content:encoded><![CDATA[<div style="position:relative; width: 100%; padding: 0 0 30px 0;"><div style="position: absolute; bottom: 10px; right:115px; width: 42px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.clientsideasp.net/2009/06/16/showing-beautiful-message-boxes-in-aspnet-web-forms-using-jquery-impromptu/';
var dzone_title = 'Showing beautiful message boxes in Asp.Net web forms using JQuery Impromptu';
var dzone_blurb = 'Impromptu is an excellent JQuery plug-in to show beautiful message boxes in web forms. Its is easy to use and can be used to make any kind of message boxes...';
var dzone_style = '2';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p><a href="http://trentrichardson.com/Impromptu/index.php" target="_blank">Impromptu</a> is an excellent JQuery plug-in to show beautiful message boxes in web forms. Its is easy to use and can be used to make any kind of message boxes such as alerts, confirm boxes, prompts, popup login boxes, popup input wizards etc</p>
<div id="attachment_68" class="wp-caption aligncenter" style="width: 437px"><img class="size-full wp-image-68" title="Confirmation message box" src="http://www.clientsideasp.net/wp-content/uploads/2009/06/impromptu1.jpg" alt="Confirmation message box" width="427" height="109" /><p class="wp-caption-text">Confirmation message box</p></div>
<p><span style="text-decoration: underline;"><strong>From their site</strong></span></p>
<blockquote><p>JQuery Impromptu is an extension to help provide a more pleasant way to spontaneously prompt a user for input. More or less this is a great replacement for an alert, prompt, and confirm.</p></blockquote>
<p><strong><a title="asp.net javascript message box" href="http://www.clientsideasp.deynu.com/alerts/Asp-net-jquery-confirm-gridview.aspx"><strong>Click here to see the DEMO and DOWNLOAD the source</strong></a></strong></p>
<p><span id="more-64"></span><span style="text-decoration: underline;"><strong>Setting up an asp.net page to use JQuery Impromptu (The download zip has all this included)</strong></span><br />
Include the latest jquery.js file<br />
Include the latest jquery-impromptu.js file<br />
Include the latest impromptu.css file</p>
<pre name="code" class="js">

&lt;script src=&quot;jquery.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;jquery-impromptu.2.6.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;link href=&quot;impromptu.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
</pre>
<p>Although the Impromptu site <a href="http://trentrichardson.com/Impromptu/index.php" target="_blank">http://trentrichardson.com/Impromptu/index.php</a> provides excellent code samples and demos on how to use this plug-in, its not straight forward to use confirm messages for Asp.Net submit buttons or link buttons. This is because you will get the result of confirm box (OK or Cancel) only in a callback result function rather than directly in the OnClientClick of the asp.net button.</p>
<p>Matt Berseth has an excellent blog about Customizing the <a href="http://mattberseth.com/blog/2008/09/dynamic_data_customizing_the_d.html" target="_blank">Delete Confirmation Dialog in Dynamic Data</a> using JQuery thick box. I used the same method to implement Impromptu confirm boxes for normal forms and Gridviews.</p>
<p>Basically the idea is - show the confirm message on the click of an html button/link and if the user opted OK in the confirm box click a hidden asp:button using JavaScript.</p>
<p><span style="text-decoration: underline;"><strong>Scenario 1 - Showing a confirm message on the submit of a web form</strong></span></p>
<p><strong>HTML</strong></p>
<pre name="code" class="xml">

&lt;!-- The button which will display in the UI and show the confirmation --&gt;
&lt;input type=&quot;button&quot; onclick=&quot;return confirmSubmit();&quot; value=&quot;Submit&quot; /&gt;

&lt;!-- Hidden asp.net command button that actually issues the submit --&gt;
&lt;asp:Button runat=&quot;server&quot; ID=&quot;btnSubmit&quot; style=&quot;display:none;&quot; OnClick=&quot;btnSubmit_Click&quot; /&gt;
</pre>
<p><strong>JavaScript<br />
</strong>
<pre name="code" class="js">

&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
function confirmSubmit()
{
$.prompt(&#039;Are you sure you want to submit?&#039;
, {
buttons: { Ok: true, Cancel: false }
, callback: confirmSubmitResult
}
);
return false;
}

function confirmSubmitResult(v,m,f)
{
if( v) //post back if the user clicked OK
$(&#039;#&lt;%= btnSubmit.ClientID %&gt;&#039;).click();
}
&lt;/script&gt;
</pre>
<p><span style="text-decoration: underline;"><strong>Scenario 2 - Show message after a postback (for example success or error messages after registration)</strong></span><br />
To show Impromptu message after postback we will make the JavaScript in the code behind and add to the page using ClientScript manager</p>
<p><strong>Codebehind</strong></p>
<pre name="code" class="c#">

//Showing JQuery prompt after Postback
protected void btnSubmit_Click(object sender, EventArgs e)
{
//The prompt function shlould be called inside $(document).ready() function inorder to avoid
//IE&#039;s &quot;Operation aborted&quot; error
//in this script we are using {{ for JQuery code becuase the string need to be used inside a String.Format
function - otherwise you need to use only one {
string prompt = &quot;&lt;script&gt;$(document).ready(function(){{$.prompt(&#039;{0}!&#039;);}});&lt;/script&gt;&quot;;
string message = string.Format(prompt, &quot;This message is coming after postback.&lt;br /&gt;Hello &quot; + txtName.Text);
ClientScript.RegisterStartupScript(typeof(Page), &quot;message&quot;, message);
}
</pre>
<p><span style="text-decoration: underline;"><strong>Scenario 3 - Showing confirm messages in list controls such as Gridview, datalist and repeater</strong></span></p>
<p><strong>HTML</strong><br />
In the Gridviews TemplateField add the hidden and visible controls as we saw in Scenario 1</p>
<pre name="code" class="xml">

&lt;asp:TemplateField&gt;
&lt;ItemTemplate&gt;
&lt;!-- The link which will display the delete confirmation --&gt;
&lt;a id=&quot;linkDelete&quot; runat=&quot;server&quot; href=&quot;#&quot; title=&quot;Confirm delete&quot;&gt;Delete&lt;/a&gt;
&lt;!-- Hidden command button that actually issues the delete --&gt;
&lt;asp:Button runat=&quot;server&quot; CommandName=&quot;Delete&quot; ID=&quot;btnDelete&quot; Style=&quot;display: none;&quot; /&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;
</pre>
<p><strong>Javascript</strong></p>
<pre name="code" class="js">

&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
function confirmDeleteResult(v,m,f)
{
if( v) //user clicked OK
$(&#039;#&#039; + f.hidID).click(); //the delete button id of each row will be passed to this function from the confirm box
}
&lt;/script&gt;
</pre>
<p>Now in the RowDataBound function of GridView write the following code in the code behind<br />
<strong>Codebehind</strong></p>
<pre name="code" class="c#">

//making the confirm box for each delete link.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// we are using a html anchor and a hidden asp:button for the delete
HtmlAnchor linkDelete = (HtmlAnchor)e.Row.FindControl(&quot;linkDelete&quot;);
Button btnDelete = (Button)e.Row.FindControl(&quot;btnDelete&quot;);

//for each delete link - the corresponding submit buttons id will be passed to delete call back as a hidden field
string prompt = &quot;$.prompt(&#039;Are you sure you want to delete the selected item?&quot;
+ &quot;&lt;input type=&quot;hidden&quot; value=&quot;{0}&quot; name=&quot;hidID&quot; /&gt;&#039;&quot;
+ &quot;, {{buttons: {{ Ok: true, Cancel: false }}, callback: confirmDeleteResult}} ); return false; &quot;;
linkDelete.Attributes[&quot;onclick&quot;] = string.Format(prompt, btnDelete.ClientID);
}
}
</pre>
<p><strong><a title="asp.net javascript message box" href="http://www.clientsideasp.deynu.com/alerts/Asp-net-jquery-confirm-gridview.aspx"><strong>Click here to see the DEMO and DOWNLOAD the source</strong></a></strong></p>
<p>Please comment on bugs or enhancements on this asp.net javascript message box implementation.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.clientsideasp.net/2009/06/16/showing-beautiful-message-boxes-in-aspnet-web-forms-using-jquery-impromptu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Database driven Asp.Net JQuery Tree</title>
		<link>http://www.clientsideasp.net/2009/03/31/database-driven-aspnet-jquery-tree/</link>
		<comments>http://www.clientsideasp.net/2009/03/31/database-driven-aspnet-jquery-tree/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 17:58:19 +0000</pubDate>
		<dc:creator>Anz</dc:creator>
		
		<category><![CDATA[Asp.Net]]></category>

		<category><![CDATA[JQuery]]></category>

		<category><![CDATA[Tree]]></category>

		<guid isPermaLink="false">http://www.clientsideasp.net/?p=41</guid>
		<description><![CDATA[<div style="position:relative; width: 100%; padding: 0 0 30px 0;"><div style="position: absolute; bottom: 10px; right:115px; width: 42px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.clientsideasp.net/2009/03/31/database-driven-aspnet-jquery-tree/';
var dzone_title = 'Database driven Asp.Net JQuery Tree';
var dzone_blurb = 'Bassistance.de has a great JQuery tree plugin and I thought to make it database driven using Asp.Net and C#. JQuery tree is a highly customizable tree...';
var dzone_style = '2';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
Bassistance.de has a great JQuery tree plugin and I thought to make it database driven using Asp.Net and C#. JQuery tree is a highly customizable tree with lot of options available. See the full list of options available with JQuery tree here (see the functions options given in the bottom table)
Click here to see the [...]]]></description>
			<content:encoded><![CDATA[<div style="position:relative; width: 100%; padding: 0 0 30px 0;"><div style="position: absolute; bottom: 10px; right:115px; width: 42px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.clientsideasp.net/2009/03/31/database-driven-aspnet-jquery-tree/';
var dzone_title = 'Database driven Asp.Net JQuery Tree';
var dzone_blurb = 'Bassistance.de has a great JQuery tree plugin and I thought to make it database driven using Asp.Net and C#. JQuery tree is a highly customizable tree...';
var dzone_style = '2';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p><a title="Asp.Net AJAX Tree using JQuery" href="http://bassistance.de/jquery-plugins/jquery-plugin-treeview/" target="_csa">Bassistance.de</a> has a great JQuery tree plugin and I thought to make it database driven using Asp.Net and C#. JQuery tree is a highly customizable tree with lot of options available. See the full list of options available with JQuery tree <a title="Asp.Net treeview JQuery" href="http://www.dynamicdrive.com/dynamicindex1/treeview/index.htm" target="_csa">here</a> (see the functions options given in the bottom table)</p>
<p><strong><a title="Asp.Net JQuery Treeview" href="http://www.clientsideasp.deynu.com/jquerytree/JQuery-Tree.aspx" target="_csa">Click here to see the DEMO and DOWNLOAD the source</a></strong></p>
<p><strong>Database Schema<br />
</strong>For Asp.Net JQuery Tree you can use the same Asp.Net tree DB schema which I explained in my <a title="asp.net treeview using jquery" href="http://www.clientsideasp.net/2009/03/27/aspnet-tree-dropdownlist-listbox/#more-27">previous post.<br />
</a>Its an N-Level tree and can be stored in a self referencing table (a table with foreign key to the same table). The table will have a PK field ID and an FK field ParentID which will refer to the ID field of same table itself.</p>
<div id="attachment_28" class="wp-caption aligncenter" style="width: 306px"><img class="size-full wp-image-28" title="DropdownList-LisBox tree DB Schema" src="http://www.clientsideasp.net/wp-content/uploads/2009/03/html-select-tree-db-schema.jpg" alt="Asp.Net Dropdownlist tree DB Schema" width="296" height="118" /><p class="wp-caption-text">Asp.Net Dropdownlist tree DB Schema</p></div>
<p><span id="more-41"></span><strong>Implementation</strong><br />
First select the whole data into a DataTable using the following SELECT query (same as in the case of dropdownlist tree – <a title="Treeview jquery with Asp.net" href="http://www.clientsideasp.net/2009/03/27/aspnet-tree-dropdownlist-listbox/">please read this post for more info</a>)</p>
<pre name="code" class="sql">

SELECT TreeNodeID
, ISNULL(ParentNodeID, 0) ParentNodeID
, Title
FROM [dbo].[TreeNode] ORDER BY ParentNodeID, TreeNodeID
</pre>
<p>Now we will recursively create a string with the tree nodes and display in a literal control.</p>
<pre name="code" class="c#">

System.Text.StringBuilder tree = new System.Text.StringBuilder();
string previousParentID = &quot;&quot;;
int level = -1;

private void RecursiveFillTree(DataTable dtParent, string parentID)
{
level++; //on the each call level increment 1
DataView dv = new DataView(dtParent);
dv.RowFilter = string.Format(&quot;ParentNodeID = {0}&quot;, parentID);
if (dv.Count &gt; 0)
{
//loop through each leaf
for (int i = 0; i &lt; dv.Count; i++)
{
//NEW NODE - make a new Unordered list element
if (previousParentID != dv[i][&quot;ParentNodeID&quot;].ToString())
{
if (level == 0) //START THE TREE
tree.Append(&quot;n&lt;ul id=&#039;ulTree&#039;&gt;&quot;);
else
tree.Append(&quot;n&lt;ul&gt;&quot;);
}
//show the leaf in an li
tree.Append(&quot;n&lt;li&gt;&lt;a href=&#039;?&quot;).Append(dv[i][&quot;TreeNodeID&quot;]).Append(&quot;&#039;&gt;&quot;).Append(dv[i][&quot;Title&quot;]).Append(&quot;&lt;/a&gt;&quot;);
//recusrively show child leafs of the current leaf
RecursiveFillTree(dtParent, dv[i][&quot;TreeNodeID&quot;].ToString());
previousParentID = dv[i][&quot;ParentNodeID&quot;].ToString();
tree.Append(&quot;n&lt;/li&gt;&quot;);
}
tree.Append(&quot;n&lt;/ul&gt;&quot;);
}
}
</pre>
<p>The above string will be set to a literal defined in the ASPX page.</p>
<pre name="code" class="html">

&lt;asp:Literal ID=&quot;litTree&quot; runat=&quot;server&quot;&gt;&lt;/asp:Literal&gt;
</pre>
<p><strong></strong>You should refer the javascript files jquery-latest.js, jquery.treeview.js and jquery.cookie.js.<br />
Also include the following JavaScript in the head portion of your ASPX</p>
<pre name="code" class="js">

&lt;script type=&quot;text/javascript&quot;&gt;
$(function() {
$(&quot;#ulTree&quot;).treeview({
collapsed: false,
animated: &quot;medium&quot;,
persist: &quot;location&quot;
});
})
&lt;/script&gt;
</pre>
<p><em>ulTree</em> is the ID of ul we have created in C#. I have used three properties available with JQuery tree and you can read the details about all the options available <a title="JQuery tree with asp.net" href="http://www.dynamicdrive.com/dynamicindex1/treeview/index.htm" target="_csa">here</a>.</p>
<p><strong><a title="Asp.Net JQuery Treeview" href="http://www.clientsideasp.deynu.com/jquerytree/JQuery-Tree.aspx" target="_csa">Click here to see the DEMO and DOWNLOAD the source</a></strong></p>
<h2><span style="text-decoration: underline;">Asynchronous Asp.Net JQuery tree</span></h2>
<p>Asynchronous implementation will be very useful when you have very very big tree and if the loading of all the nodes in HTML affect the page load time.</p>
<p>In that case we can show only the root nodes and when some one click the expand button we can send a request to server and load the child nodes for that root node and so on.</p>
<p>The implementation of Asynchronous Asp.Net JQuery tree is very similar to the normal Asp.Net JQuery tree but in this case we will generate a JSON array object having all the node info and write it to the Response.</p>
<p>In the code behind we can get the Asynchronous call by checking the parameter <em>root </em>. If the parameter value is <em>source</em> the Asynchronous request will be for root nodes. And for all the child nodes we will get the ID in <em>root</em> parameter.</p>
<pre name="code" class="c#">

public void AsyncTree()
{
string root = Request.Params[&quot;root&quot;];
int parentID = 0;
Tree objTree = new Tree();
//select all the nodes - you can make it more efficient by
//storing the datatable Cache to avoid frequent requests to DB
DataTable dtNodes  = objTree.Select(0);
if (root == &quot;source&quot;) //for the first time the JQuery tree will send the root param value as &quot;source&quot;
{
GenerateTree(dtNodes, 0);
}
else if (int.TryParse(root, out parentID)) //subsequent requests will send the ID
{
if (parentID &gt; 0)
{
GenerateTree(dtNodes, parentID);
}
}
}

private void GenerateTree(DataTable dtParent, int parentID)
{
System.Text.StringBuilder tree = new System.Text.StringBuilder();
DataView dv = new DataView(dtParent);
dv.RowFilter = string.Format(&quot;ParentNodeID = {0}&quot;, parentID);
tree.Append(&quot;[&quot;);
//loop through each leaf
for (int i = 0; i &lt; dv.Count; i++)
{
tree.Append(&quot;{&quot;);
tree.Append(&quot;&quot;text&quot;: &quot;&quot;).Append(dv[i][&quot;Title&quot;]).Append(&quot;&quot;,&quot;);
tree.Append(&quot;&quot;id&quot;: &quot;&quot;).Append(dv[i][&quot;TreeNodeID&quot;]).Append(&quot;&quot;,&quot;);

//check whether this node has child nodes
DataView dvChild = new DataView(dtParent);
dvChild.RowFilter = string.Format(&quot;ParentNodeID = {0}&quot;, dv[i][&quot;TreeNodeID&quot;]);
if (dvChild.Count &gt; 0) //if so mark it in the return node array
tree.Append(&quot;&quot;hasChildren&quot;: true&quot;);
tree.Append(&quot;},&quot;);
}
//remove the ending comma from the result
if (tree.Length &gt; 1)
{
tree = tree.Remove(tree.Length - 1, 1);
}
tree.Append(&quot;]&quot;);
//put the result in Response and end the Response
Response.Write(tree.ToString());
Response.End();
}
</pre>
<p>If a node has child nodes we will set the <em>hasChildren </em>parameter <em>true</em>.<br />
<a title="Asp.Net Asynchronous JQuery tree " href="http://www.clientsideasp.deynu.com/jquerytree/JQuery-Tree-Asynch.aspx" target="_csa"><strong>Click here for Asynchronous Asp.Net JQuery tree DEMO and DOWNLOAD the source.</strong></a></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.clientsideasp.net/2009/03/31/database-driven-aspnet-jquery-tree/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Asp.Net Tree DropdownList &amp; ListBox</title>
		<link>http://www.clientsideasp.net/2009/03/27/aspnet-tree-dropdownlist-listbox/</link>
		<comments>http://www.clientsideasp.net/2009/03/27/aspnet-tree-dropdownlist-listbox/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 12:34:47 +0000</pubDate>
		<dc:creator>Anz</dc:creator>
		
		<category><![CDATA[Asp.Net]]></category>

		<category><![CDATA[Tree]]></category>

		<guid isPermaLink="false">http://www.clientsideasp.net/?p=27</guid>
		<description><![CDATA[<div style="position:relative; width: 100%; padding: 0 0 30px 0;"><div style="position: absolute; bottom: 10px; right:115px; width: 42px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.clientsideasp.net/2009/03/27/aspnet-tree-dropdownlist-listbox/';
var dzone_title = 'Asp.Net Tree DropdownList &#038; ListBox';
var dzone_blurb = 'Ever needed to display data in tree format inside an asp.net DropDownList or ListBox?.A simple search for &#8220;tree dropdown list&#8221; returned lot...';
var dzone_style = '2';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
Ever needed to display data in tree format inside an asp.net DropDownList or ListBox?.
A simple search for &#8220;tree dropdown list&#8221; returned lot of requests for asp.net dropdown tree. See here, here &#38; here to see questions about dropdown list tree control in Asp.Net.
So I thought to blog about how to implement an asp.net tree dropdown [...]]]></description>
			<content:encoded><![CDATA[<div style="position:relative; width: 100%; padding: 0 0 30px 0;"><div style="position: absolute; bottom: 10px; right:115px; width: 42px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.clientsideasp.net/2009/03/27/aspnet-tree-dropdownlist-listbox/';
var dzone_title = 'Asp.Net Tree DropdownList &#038; ListBox';
var dzone_blurb = 'Ever needed to display data in tree format inside an asp.net DropDownList or ListBox?.A simple search for &#8220;tree dropdown list&#8221; returned lot...';
var dzone_style = '2';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p>Ever needed to display data in tree format inside an asp.net DropDownList or ListBox?.</p>
<p>A simple search for &#8220;tree dropdown list&#8221; returned lot of requests for asp.net dropdown tree. See <a title="Tree dropdown" href="http://forums.asp.net/t/839081.aspx" target="_csa">here</a>, <a title="dropdown tree" href="http://forums.asp.net/p/1108704/1702674.aspx" target="_csa">here</a> &amp; <a title="tree list box" href="http://forums.asp.net/p/1003245/1325999.aspx" target="_csa">here</a> to see questions about dropdown list tree control in Asp.Net.</p>
<p>So I thought to blog about how to implement an asp.net tree dropdown list using c#.</p>
<p>One way to create dropdown list tree is show/hide JavaScript tree inside a div and simulate a dropdown display. But here am going to explain a very simple implementation using recursion. There is no JavaScript involved.</p>
<p><a title="asp.net tree dropdown list" href="http://www.clientsideasp.deynu.com/tree/Tree-DropDownList-ListBox-.aspx" target="_csa"><strong>Click here to see the DEMO and DOWNLOAD the source</strong></a></p>
<p><strong>Features</strong></p>
<ol>
<li>Show data in tree format inside a dropdown list or listbox.</li>
<li>N-levels of tree nodes are possible.</li>
<li>No JavaScript.</li>
<li>All the usual dropdown list and listbox properties such as AutoPostaBack and multi selection is available</li>
<li>Admin side to add/update/delete nodes to the tree</li>
</ol>
<p><span id="more-27"></span></p>
<p><strong>Database Schema<br />
</strong>An N-Level tree can be stored in a self referencing table (a table with foreign key to the same table). The table will have a PK field ID and an FK field ParentID which will refer to the ID field of same table itself.</p>
<div id="attachment_28" class="wp-caption aligncenter" style="width: 306px"><img class="size-full wp-image-28" title="DropdownList-LisBox tree DB Schema" src="http://www.clientsideasp.net/wp-content/uploads/2009/03/html-select-tree-db-schema.jpg" alt="Asp.Net Dropdownlist tree DB Schema" width="296" height="118" /><p class="wp-caption-text">Asp.Net Dropdownlist tree DB Schema</p></div>
<p>For the root nodes ParentID will be NULL. Take a look at the sample data given below</p>
<div id="attachment_29" class="wp-caption aligncenter" style="width: 362px"><img class="size-full wp-image-29" title="Dropdown Tree DB Sample Data" src="http://www.clientsideasp.net/wp-content/uploads/2009/03/asp-net-dropdown-tree-db-data.jpg" alt="Asp.net DropdownList Tree DB Sample Data" width="352" height="299" /><p class="wp-caption-text">Asp.net DropdownList Tree DB Sample Data</p></div>
<p><strong>Implementation<br />
</strong>First select the whole data into a DataTable using the following SELECT query</p>
<pre name="code" class="sql">

SELECT TreeNodeID
, ISNULL(ParentNodeID, 0) ParentNodeID
, Title
FROM [dbo].[TreeNode] ORDER BY ParentNodeID, TreeNodeID
</pre>
<p>In the above query we are converting ParentID to zero for all the root nodes (having value NULL). This is important and you will understand why we are doing that when I explain the C# code.</p>
<p>Now in the C# code we will recursively insert Nodes to an Asp.Net drop down list from the datatable. On each iteration we will append proper indention and pointer at the front of the Title before inserting to drop down.</p>
<pre name="code" class="c#">

int level = -1;
private void RecursiveFillTree(DataTable dtParent, int parentID)
{
level++; //on the each call level increment 1
StringBuilder appender = new StringBuilder();
for (int j = 0; j &lt; level; j++)
appender.Append(&quot;&amp;amp;amp;amp;amp;amp;amp;amp;nbsp;&amp;amp;amp;amp;amp;amp;amp;amp;nbsp;&amp;amp;amp;amp;amp;amp;amp;amp;nbsp;&amp;amp;amp;amp;amp;amp;amp;amp;nbsp;&quot;);
if (level &gt; 0)
appender.Append(&quot;|__&quot;);

DataView dv = new DataView(dtParent);
dv.RowFilter = string.Format(&quot;ParentNodeID = {0}&quot;, parentID);
int i;
if (dv.Count &gt; 0)
{
for (i = 0; i &lt; dv.Count; i++)
{
ddlParentNode.Items.Add(new ListItem(Server.HtmlDecode( appender.ToString() + dv[i][&quot;Title&quot;].ToString()), dv[i][&quot;TreeNodeID&quot;].ToString()));
RecursiveFillTree(dtParent, int.Parse( dv[i][&quot;TreeNodeID&quot;].ToString()));
}
}
level--; //on the each function end level will decrement by 1
}
</pre>
<p>On each iteration we will filter the ParentID with the ID to find the child nodes of that node. On the first iteration we will use Zero as the ParentID. The variable <em>level</em> will keep the level of recursion and give proper indention.</p>
<p>I have also created a form to INSERT/UPDATE nodes into the drop down tree. <a href="http://www.clientsideasp.deynu.com/tree/Add-Tree-ListBox-DropDownList.aspx" target="_csa" title="listbox tree">Please click here to see it</a>. If you delete a node from dropdown tree all the child nodes will automatically move to the immediate parent. That logic is written in the Stored procedure and you can change it to the way you want.</p>
<p><strong><a title="dropdown list tree display" href="http://www.clientsideasp.deynu.com/tree/Tree-DropDownList-ListBox-.aspx" target="_csa"><strong>Click here to see the DEMO and DOWNLOAD the source</strong></a></strong></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.clientsideasp.net/2009/03/27/aspnet-tree-dropdownlist-listbox/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Asp.Net AJAX Poll using JQuery – A complete implementation with Admin part</title>
		<link>http://www.clientsideasp.net/2009/03/01/aspnet-ajax-poll-using-jquery-a-complete-implementation-with-admin-part/</link>
		<comments>http://www.clientsideasp.net/2009/03/01/aspnet-ajax-poll-using-jquery-a-complete-implementation-with-admin-part/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 18:18:26 +0000</pubDate>
		<dc:creator>Anz</dc:creator>
		
		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[JQuery]]></category>

		<category><![CDATA[Page Methods]]></category>

		<category><![CDATA[Poll]]></category>

		<guid isPermaLink="false">http://www.clientsideasp.net/?p=7</guid>
		<description><![CDATA[<div style="position:relative; width: 100%; padding: 0 0 30px 0;"><div style="position: absolute; bottom: 10px; right:115px; width: 42px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.clientsideasp.net/2009/03/01/aspnet-ajax-poll-using-jquery-a-complete-implementation-with-admin-part/';
var dzone_title = 'Asp.Net AJAX Poll using JQuery – A complete implementation with Admin part';
var dzone_blurb = 'In this blog post am going to explain how to develop an Asp.Net AJAX poll system using JQuery, which allows users to express there opinion and see the...';
var dzone_style = '2';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
In this blog post am going to explain how to develop an Asp.Net AJAX poll system using JQuery, which allows users to express there opinion and see the results. The system will have a back-end (admin part) to add and manage polls.
Click here to see the DEMO and DOWNLOAD the source
Asp.Net AJAX Poll Admin

Create a [...]]]></description>
			<content:encoded><![CDATA[<div style="position:relative; width: 100%; padding: 0 0 30px 0;"><div style="position: absolute; bottom: 10px; right:115px; width: 42px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.clientsideasp.net/2009/03/01/aspnet-ajax-poll-using-jquery-a-complete-implementation-with-admin-part/';
var dzone_title = 'Asp.Net AJAX Poll using JQuery – A complete implementation with Admin part';
var dzone_blurb = 'In this blog post am going to explain how to develop an Asp.Net AJAX poll system using JQuery, which allows users to express there opinion and see the...';
var dzone_style = '2';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p>In this blog post am going to explain how to develop an Asp.Net AJAX poll system using JQuery, which allows users to express there opinion and see the results. The system will have a back-end (admin part) to add and manage polls.</p>
<p><strong><a href="http://clientsideasp.deynu.com/poll/Poll_CS.aspx?" target="_blank">Click here to see the DEMO and DOWNLOAD the source</a></strong></p>
<p><strong>Asp.Net AJAX Poll </strong><strong>Admin</strong></p>
<ol>
<li>Create a new Poll with unlimited number of Choices</li>
<li>Configure how to block repeated voting. (By IP address or Cookie)</li>
<li>Activate/Deactivate Polls</li>
<li>Edit/Delete existing poll</li>
</ol>
<p><strong>Asp.Net AJAX Poll </strong><strong>User side</strong></p>
<ol>
<li>Display an active poll randomly or by using the Poll ID (This is just for demo purpose you can change the logic as you wanted)</li>
<li>Allow the user to vote and display the result without refreshing the whole page</li>
</ol>
<p><span id="more-7"></span><strong>Technologies used</strong></p>
<ol>
<li>Asp.Net in the server side</li>
<li>JQuery for client side processing and communication with server using AJAX</li>
<li>SQL Server 2005 to store the data. We use Stored Procedures to interact with tables.</li>
<li>Microsoft data application blocks for the data access layer.</li>
</ol>
<p><strong>Using JQuery to call Asp.Net functions from client side</strong><br />
Its really easy to call server side functions from client side using JQuery. Its efficient than using Asp.Net AJAX Updatepanels. For more details about using JQuery with Asp.Net page methods refer following great blog posts<br />
<a href="http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/" target="_blank">http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/</a><br />
<a href="http://encosia.com/2008/06/05/3-mistakes-to-avoid-when-using-jquery-with-aspnet-ajax/" target="_blank">http://encosia.com/2008/06/05/3-mistakes-to-avoid-when-using-jquery-with-aspnet-ajax/</a></p>
<p><strong>Working with Microsoft data application blocks data access layer</strong><br />
Microsoft data application block is part of Microsoft Enterprise library. It’s a free, ready to use and data access layer.</p>
<p>Please read following blog post to see how Microsoft data application block can easily reduce the database interaction code.<br />
<a href="http://anzme.blogspot.com/2009/02/microsoft-enterprise-data-application.html" target="_blank">http://anzme.blogspot.com/2009/02/microsoft-enterprise-data-application.html</a></p>
<p><strong>Database Schema</strong><br />
The database schema consists of three tables:</p>
<ol>
<li>Poll: This table stores the question and configuration for a poll</li>
<li>PollChoices: This table stores the choices of each poll and the vote count for each choice.</li>
<li>PollIPs: This table stores the IP address of all the voted users for each poll. This table will be used to block repeated vote per IP address.</li>
</ol>
<p>Take a look at the schema shown below</p>
<div id="attachment_10" class="wp-caption aligncenter" style="width: 541px"><img class="size-full wp-image-10" title="Asp.Net Ajax Poll using JQuery db Schema" src="http://www.clientsideasp.net/wp-content/uploads/2009/03/asp-net-ajax-poll-db-schema.gif" alt="DB Schema of Asp.Net Ajax Poll using JQuery" width="531" height="136" /><p class="wp-caption-text">DB Schema of Asp.Net Ajax Poll using JQuery</p></div>
<p>Now I will explain the source code of each page</p>
<p><strong>1. <a href="http://clientsideasp.deynu.com/poll/AddPoll_CS.aspx" target="_blank">AddPoll_CS.aspx</a></strong><br />
We use this page to insert a new Poll and edit an existing Poll.</p>
<div id="attachment_19" class="wp-caption aligncenter" style="width: 598px"><img class="size-full wp-image-19" title="add-aspnet-poll" src="http://www.clientsideasp.net/wp-content/uploads/2009/03/add-aspnet-poll.gif" alt="Add Asp.Net AJAX Poll" width="588" height="270" /><p class="wp-caption-text">Add Asp.Net AJAX Poll</p></div>
<p>In the HTML source we have one textbox (<em>txtQuestion</em> - required field) to enter the Poll Question, 3 radio buttons (<em>rdoCookie, rdoIP &amp; rdoNone</em>) to specify how to block repeated voting, a check box (<em>chkActive</em>) to specify whether this poll is currently active or not (only active polls will be showed in the user side).<br />
To enter the Poll choices we are using a HTML input texts (<em>txtChoice</em>). In the INSERT mode we will show two inputs by default and the user can add as many choices as he wants.<br />
The hidden fields <em>hidPollID, hidPollChoiceID</em> will be used to UPDATE the Poll and Choices while in edit mode.</p>
<p>In the Javascript the function <em>addFormField</em>() will be used to add new Choices in the form.<br />
The function <em>showRowIndexs</em>(); show the Choice number (Choice1, Choice 2 etc) while adding new choices.<br />
The function <em>removeFormField</em>(id) will be used to remove the corresponding Choice from form and from the DB if in edit mode.</p>
<p>The C# source is easy and straightforward please read the inline comments in the C# source code to know how it work and let me know if you have any queries.</p>
<p><strong>2. <a href="http://clientsideasp.deynu.com/poll/ListPoll_CS.aspx" target="_blank">ListPoll_CS.aspx</a></strong><br />
List all the existing polls to edit or delete.<br />
A simple Gridview is used to display the data. The code is straightforward and easy to understand</p>
<p><strong>3. <a href="http://clientsideasp.deynu.com/poll/Poll_CS.aspx" target="_blank">Poll_CS.aspx</a></strong><br />
This page will display a random active poll if the user visit this page directly (use this logic when you use the poll in user side ) or show a specific poll if the pollID is passed through the QueryString.</p>
<div id="attachment_22" class="wp-caption aligncenter" style="width: 505px"><img class="size-full wp-image-22" title="Asp.Net AJAX Poll" src="http://www.clientsideasp.net/wp-content/uploads/2009/03/jquery-poll-page.gif" alt="Asp.Net AJAX Poll" width="495" height="307" /><p class="wp-caption-text">Asp.Net AJAX Poll</p></div>
<p>In the HTML source the literal <em>litQuestion </em>will show the Poll Question and the repeater <em>rptChoices </em>will show  all the choices.<br />
On clicking the HTML input button <em>btnSubmit </em>we  will call an Asp.Net page method using JQuery. That page method will update the Poll DB and return the Poll results.</p>
<p>The Javascript function <em>animateResults</em>() will be used to animate the Poll result.</p>
<p>In the above javascript we will first check whether the user is already polled or not in the ready function and if the user is already polled we will just call the <em>animateResults</em>() and show the results.</p>
<p><strong><a href="http://clientsideasp.deynu.com/poll/Poll_CS.aspx?" target="_blank">Click here to see the DEMO and DOWNLOAD the source</a></strong></p>
<p><strong>I am using VS 2008 but the source is compatiable with .Net 2.0 also. To make it work in .Net 2.0 just remove the web.config in the zip and add a new one from VS 2005. Make sure to add the Connection string in web.config</strong></p>
<p>I have only recently started working with JQuery and in no way am an expert of any technology,  so I am sure the above scripts can be written in more effective and efficient manner. Please post your comments on any improvements.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.clientsideasp.net/2009/03/01/aspnet-ajax-poll-using-jquery-a-complete-implementation-with-admin-part/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ClientSideAsp.Net released</title>
		<link>http://www.clientsideasp.net/2009/03/01/hello-world/</link>
		<comments>http://www.clientsideasp.net/2009/03/01/hello-world/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 17:00:49 +0000</pubDate>
		<dc:creator>Anz</dc:creator>
		
		<category><![CDATA[Off Topic]]></category>

		<guid isPermaLink="false">http://www.clientsideasp.net//?p=1</guid>
		<description><![CDATA[<div style="position:relative; width: 100%; padding: 0 0 30px 0;"><div style="position: absolute; bottom: 10px; right:115px; width: 42px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.clientsideasp.net/2009/03/01/hello-world/';
var dzone_title = 'ClientSideAsp.Net released';
var dzone_blurb = 'Its been long time since I am planning to start a blog on Asp.Net, AJAX, DHTML etc. The domain is registered almost 6 months ago and I finished the samples...';
var dzone_style = '2';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
Its been long time since I am planning to start a blog on Asp.Net, AJAX, DHTML etc. The domain is registered almost 6 months ago and I finished the samples for my first tutorail 2 months ago [;)] The main reason it got delayed is because of my poor writing skills. Please adjust with me [...]]]></description>
			<content:encoded><![CDATA[<div style="position:relative; width: 100%; padding: 0 0 30px 0;"><div style="position: absolute; bottom: 10px; right:115px; width: 42px;"><script type="text/javascript">
<!--
var dzone_url = 'http://www.clientsideasp.net/2009/03/01/hello-world/';
var dzone_title = 'ClientSideAsp.Net released';
var dzone_blurb = 'Its been long time since I am planning to start a blog on Asp.Net, AJAX, DHTML etc. The domain is registered almost 6 months ago and I finished the samples...';
var dzone_style = '2';
//-->
</script>
<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script> 
</div>
<p>Its been long time since I am planning to start a blog on Asp.Net, AJAX, DHTML etc. The domain is registered almost 6 months ago and I finished the samples for my first tutorail 2 months ago [;)] The main reason it got delayed is because of my poor writing skills. Please adjust with me on my bad English.</p>
<p>As the name suggests, in this blog am mainly gonna concenrate on the client side aspects of Asp.Net like AJAX, Flex, Flash, Silverlight, CSS, HTML etc.</p>
<p>I have another development blog in <a title="Anz's blog" href="http://anzme.blogspot.com" target="_blank">blogspot</a> but I got inspired from numerous wordpress + php + design blogs like <a href="http://webresourcesdepot.com/" target="_blank">Webresources Depot</a>, <a href="http://www.smashingmagazine.com/" target="_blank">Smashing Magazine</a>, <a href="http://net.tutsplus.com/" target="_blank">NETTUTS</a> (all are big names [;)] ).</p>
<p>I am not an expert of any technology so please post if you see any bugs, improvements etc in my posts. I will try to write at least two article every month with demo and source. ClientSideAsp.Net demos will be hosted in <a href="http://deynu.com/" target="_blank">Deynu.com</a>.</p>
<p>Thanks <a href="http://webrevolutionary.com/curious/" target="_blank">Eddie</a> for the excellent wordpress theme and <a href="http://alexgorbatchev.com" target="_blank">Alex Gorbatchev</a> for the great syntax highlighter</p>
<p>Happy coding&#8230;</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.clientsideasp.net/2009/03/01/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
