<?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>Pedrera Philadelphia Web Design &#38; Development BlogPedrera Philadelphia Web Design &amp; Development Blog</title>
	<atom:link href="http://www.pedrera.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pedrera.com/blog</link>
	<description>Web Design &#38; Development Articles</description>
	<lastBuildDate>Mon, 31 Dec 2012 19:47:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<meta name="generator" content="Obscure 2.0" />
		<item>
		<title>Installing ExpressionEngine on a Rackspace Cloud Server</title>
		<link>http://www.pedrera.com/blog/expressionengine-on-rackspace-cloud/</link>
		<comments>http://www.pedrera.com/blog/expressionengine-on-rackspace-cloud/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 18:25:29 +0000</pubDate>
		<dc:creator>Tim Carter</dc:creator>
				<category><![CDATA[ExpressionEngine]]></category>

		<guid isPermaLink="false">http://www.pedrera.com/blog/?p=68</guid>
		<description><![CDATA[<p>Introduction This article is intended to provide a general approach to installing ExpressionEngine on a Rackspace Cloud Server running Linux. In our sample, we’re working with a server running Ubuntu. Other Linux operating systems should be pretty similar, and you can get OS-specific instructions at the Rackspace Cloud Knowledgebase (http://cloudservers.rackspacecloud.com/index.php/Main_Page). The process of installing ExpressionEngine on the Rackspace Cloud involves several tasks, from installing the LAMP stack to setting file permissions in ExpressionEngine. These topics are covered more comprehensively on &#8230; <a href="http://www.pedrera.com/blog/expressionengine-on-rackspace-cloud/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.pedrera.com/blog/expressionengine-on-rackspace-cloud/">Installing ExpressionEngine on a Rackspace Cloud Server</a> appeared first on <a href="http://www.pedrera.com/blog">Pedrera Philadelphia Web Design &amp; Development Blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Introduction</h2>
<p>
This article is intended to provide a general approach to installing ExpressionEngine on a Rackspace Cloud Server running Linux.
</p>
<p>In our sample, we’re working with a server running Ubuntu. Other Linux operating systems should be pretty similar, and you can get OS-specific instructions at the <i>Rackspace Cloud Knowledgebase</i> (<a href="http://cloudservers.rackspacecloud.com/index.php/Main_Page" target="_blank">http://cloudservers.rackspacecloud.com/index.php/Main_Page)</a>.
</p>
<p>
The process of installing ExpressionEngine on the Rackspace Cloud involves several tasks, from installing the LAMP stack to setting file permissions in ExpressionEngine. These topics are covered more comprehensively on other blogs, so this article is really just a documented process that references those other blogs with a few comments of my own. That said, let’s get started.
</p>
<h2>Server Setup</h2>
<h3>1.	Basic Setup</h3>
<p>
The first part of the process is to get your Linux server ready with your user accounts and firewall rules. Rackspace provides a procedure for each Linux OS. Find yours on the list, and complete the steps outlined therein. Here’s their list:<br />
<br />
<a href="http://cloudservers.rackspacecloud.com/index.php/List_of_Articles#Linux" target="_blank">http://cloudservers.rackspacecloud.com/index.php/List_of_Articles#Linux</a>
</p>
<p>
Since we are running Ubuntu, we performed the procedures here:<br />
<br />
<a href="http://cloudservers.rackspacecloud.com/index.php/Ubuntu_-_Setup" target="_blank">http://cloudservers.rackspacecloud.com/index.php/Ubuntu_-_Setup</a>
</p>
<p>
To make a terminal connection to your server, you can use a client application or the console interface provided by Rackspace. To access the console, follow these steps:
</p>
<p>
Login to the Rackspace Cloud to access your account, and click on “Cloud Servers”.
</p>
<p>
<a href="http://www.pedrera.com/blog/wp-content/uploads/2011/04/Expression-Engine-on-Rackspace-Cloud-1.png"><img src="http://www.pedrera.com/blog/wp-content/uploads/2011/04/Expression-Engine-on-Rackspace-Cloud-1-300x211.png" alt="Expression-Engine-on-Rackspace-Cloud-1" title="Expression-Engine-on-Rackspace-Cloud-1" width="300" height="211" class="alignleft size-medium wp-image-83" /></a><br />
Click on the server that you intend to use for hosting the EE site.<br clear="all">
</p>
<p>
<a href="http://www.pedrera.com/blog/wp-content/uploads/2011/04/Expression-Engine-on-Rackspace-Cloud-2.png"><img src="http://www.pedrera.com/blog/wp-content/uploads/2011/04/Expression-Engine-on-Rackspace-Cloud-2-300x241.png" alt="Expression-Engine-on-Rackspace-Cloud-2" title="Expression-Engine-on-Rackspace-Cloud-2" width="300" height="241" class="alignleft size-medium wp-image-84" /></a><br />
On the resulting page, click “Console”. This will open a browser window wherein you can perform the terminal commands noted in the Rackspace set up documentation and those noted below.<br clear="all">
</p>
<h3>2.	Install the LAMP Stack</h3>
<p>
Next, we’re going to install Apache, PHP and MySQL with one command, as documented here:<br />
<br />
<a href="http://tuxtweaks.com/2010/04/installing-lamp-on-ubuntu-10-04-lucid-lynx/" target="_blank">http://tuxtweaks.com/2010/04/installing-lamp-on-ubuntu-10-04-lucid-lynx/</a>.
</p>
<p><code>
<pre>sudo apt-get install lamp-server^</pre>
<p></code></p>
<p>
Be sure to include the caret (^). The command will not work without it.
</p>
<p>
Restart Apache
</p>
<p><code>
<pre>sudo /etc/init.d/apache2 restart</pre>
<p></code></p>
<p>
Refer to the blog article linked above if you need more detailed information.
</p>
<h3>3.	Install phpMyAdmin</h3>
<p><code>
<pre>sudo apt-get install libapache2-mod-auth-mysql phpmyadmin</pre>
<p></code></p>
<p>
Test it all out by opening phpMyAdmin at http://YOUR-IP/phpmyadmin/
</p>
<h3>4.	Enable FTP Connections</h3>
<p>Here is the command, but refer to this post for more detailed information:<br />
<br />
<a href="http://cloudservers.rackspacecloud.com/index.php/Introduction_to_iptables#Allowing_connections_to_FTP" target="_blank">http://cloudservers.rackspacecloud.com/index.php/Introduction_to_iptables#Allowing_connections_to_FTP</a>
</p>
<p><code>
<pre>sudo iptables -I INPUT 1 -p tcp --dport 21 -j ACCEPT</pre>
<p></code></p>
<h3>5.	Install FTP Server</h3>
<p>
I used vsftpd (<a href="https://help.ubuntu.com/10.10/serverguide/C/ftp-server.html" target="_blank">https://help.ubuntu.com/10.10/serverguide/C/ftp-server.html</a>), but you can use whatever you prefer. Be sure to follow FTP software documentation to ensure proper security!
</p>
<p><code>
<pre>sudo apt-get install vsftpd</pre>
<p></code></p>
<h3>6.	Set the permissions on the web directory</h3>
<p>
The user created in step 1 (Rackspace Server Setup) should have their home directory set to /var/www. Use this command:
</p>
<p><code>
<pre>sudo usermod -d /var/www yourusername</pre>
<p></code></p>
<p>
Now set this user as the owner:
</p>
<p><code>
<pre>sudo chown yourusername /var/www
sudo chgrp yourusername /var/www</pre>
<p></code></p>
<h3>7.	Secure Web Server</h3>
<p>
I can&#8217;t give specifics on this, as each environment is unique, as are the security needs for your website. However, you should look into disabling directory listing and the like. This is a pretty good post about that:<br />
<br />
<a href="http://www.techrepublic.com/blog/10things/10-things-you-should-do-to-secure-apache/477" target="_blank">10 things you should do to secure Apache</a>
</p>
<h3>8.	Enable mod_rewrite</h3>
<p>
In some instances, you may need to enable mod_rewrite. This is necessary if you want friendly URLs, as documented here: <a href="http://expressionengine.com/wiki/Remove_index.php_From_URLs/" target="_blank">Remove index.php From URLs</a><br />
<br />
To enable mod_rewrite, use this command:
</p>
<p><code>
<pre>sudo a2enmod rewrite</pre>
<p></code></p>
<h2>Install ExpressionEngine</h2>
<p>
We’ll be following the ExpressionEngine installation instructions found here, <a href="http://expressionengine.com/user_guide/installation/installation.html" target="_blank">http://expressionengine.com/user_guide/installation/installation.html</a>. <strong>But note that our step 4, “Set Base Permissions” is needed after uploading the ExpressionEngine files.</strong>
</p>
<h3>1.	Create the MySQL database</h3>
<p>
Login to phpMyAdmin at http://YOUR-IP/phpmyadmin/ to create the database that you intend to use for ExpressionEngine. You will need to create a database user (it’s not good security to use the root account). Note the database name, user and password. You’ll need it during the ExpressionEngine installation.
</p>
<h3>2.	Download ExpressionEngine</h3>
<p>Download your copy of ExpressionEngine, and rename the “system” folder as noted in Step 2 here:<br />
<br />
<a href="http://expressionengine.com/user_guide/installation/installation.html" target="_blank">http://expressionengine.com/user_guide/installation/installation.html</a>
</p>
<h3>3.	Upload ExpressionEngine Files</h3>
<p>Upload the ExpressionEngine files to your web server via FTP.</p>
<h3>4.	Set Base Permissions</h3>
<p>Ensure that the files that you uploaded to your website root have 755 for permissions, including sud-directories.</p>
<p><code>
<pre>sudo chmod 755 /var/www/*</pre>
<p></code></p>
<h3>5.	Set the ExpressionEngine File Permissions</h3>
<p>
As documented in &#8220;Step 4, Set File Permissions&#8221; of the <i>ExpressionEngine Installation</i> process, set the permissions for specific directories. You can do this through FTP or sudo chmod.</p>
<h3>6.	Run the Installation Wizard</h3>
<p>
We’re now ready to run the installation wizard, as documented here:<br />
<br />
<a href="http://expressionengine.com/user_guide/installation/installation_wizard.html" target="_blank">http://expressionengine.com/user_guide/installation/installation_wizard.html</a>.
</p>
<h2>That&#8217;s It</h2>
<p>
You should now have ExpressionEngine running on your Rackspace Cloud site!
</p>
<p>Need some help with your project? Learn more about Pedrera&#8217;s <a href="http://www.pedrera.com/solutions/cms/expressionengine-developer/">ExpressionEngine Developer services</a>.</p>
<p>The post <a href="http://www.pedrera.com/blog/expressionengine-on-rackspace-cloud/">Installing ExpressionEngine on a Rackspace Cloud Server</a> appeared first on <a href="http://www.pedrera.com/blog">Pedrera Philadelphia Web Design &amp; Development Blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.pedrera.com/blog/expressionengine-on-rackspace-cloud/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Enabling Expression Engine Forms within Magento</title>
		<link>http://www.pedrera.com/blog/enabling-expression-engine-forms-within-magento/</link>
		<comments>http://www.pedrera.com/blog/enabling-expression-engine-forms-within-magento/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 20:19:56 +0000</pubDate>
		<dc:creator>Tim Carter</dc:creator>
				<category><![CDATA[ExpressionEngine]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Magento eCommerce]]></category>

		<guid isPermaLink="false">http://www.pedrera.com/blog/?p=47</guid>
		<description><![CDATA[<p>We recently had a new client come to us to troubleshoot issues with a Magento eCommerce website that has been configured use ExpressionEngine for CMS. Their previous developers didn&#8217;t provide documentation, but we determined that their approach was based on the Magento tutorial Integrating 3rd Party CMS Content Within Magento. Among other issues, the forms created in ExpressionEngine using Freeform and native EE tools were not functioning. The problem boiled down to the fact that, as prescribed in the tutorial &#8230; <a href="http://www.pedrera.com/blog/enabling-expression-engine-forms-within-magento/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.pedrera.com/blog/enabling-expression-engine-forms-within-magento/">Enabling Expression Engine Forms within Magento</a> appeared first on <a href="http://www.pedrera.com/blog">Pedrera Philadelphia Web Design &amp; Development Blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>We recently had a new client come to us to troubleshoot issues with a Magento eCommerce website that has been configured use ExpressionEngine for CMS. Their previous developers didn&#8217;t provide documentation, but we determined that their approach was based on the Magento tutorial <em><a href="http://www.magentocommerce.com/knowledge-base/entry/tutorial-integrating-3rd-party-cms-content-within-magento" target="_blank">Integrating 3rd Party CMS Content Within Magento</a></em>. Among other issues, the forms created in ExpressionEngine using Freeform and native EE tools were not functioning.</p>
<p>The problem boiled down to the fact that, as prescribed in the tutorial noted above, ExpressionEngine was installed in a directory (i.e. &#8211; yourdomain.com/ee). However, to maintain the CMS integration with the Magento theme, ExpressionEngine&#8217;s setting for &#8220;General Configuration &gt; URL to the root directory of your site&#8221; needs to be set to &#8220;yourdomain.com&#8221;. No &#8220;ee&#8221; directory.</p>
<p>The result is that Freeform&#8217;s form target is something like this:</p>
<p><code>
<pre>&lt;form id="freeform" action="http://www.yourdomain.com/" method="post"&gt;</pre>
<p></code></p>
<p>As you can see, the form is posting to the Magento site at the root &#8212; NOT the EE root. Obviously, this will never work, but we can&#8217;t change the &#8220;URL to the root directory of your site&#8221; without undoing all the CMS integration.</p>
<h2>Solution: Update the ExpressionEngine Form Target with jQuery</h2>
<p>The solution is rather simple. And as is often the case, it is jQuery to the rescue. By adding the following to your Magento site&#8217;s head, you will change the target of the forms to yourdomain.com/ee.</p>
<p><code>
<pre>&lt;script type="text/javascript"&gt;
$(document).ready(function () {
	$("#freeform").submit(function () {
		$(this).attr("action", "http://www.yourdomain.com/ee/")
	});
});
&lt;/script&gt;</pre>
<p></code></p>
<p>Naturally, this assumes that you have jQuery going. You might also need to set &#8220;jQuery.noConflict();&#8221;. But all in all, pretty simple stuff.</p>
<p><a href="http://www.pedrera.com/solutions/cms/expressionengine-developer/">Pedrera Philadelphia&#8217;s ExpressionEngine Developer Services</a></p>
<p>The post <a href="http://www.pedrera.com/blog/enabling-expression-engine-forms-within-magento/">Enabling Expression Engine Forms within Magento</a> appeared first on <a href="http://www.pedrera.com/blog">Pedrera Philadelphia Web Design &amp; Development Blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.pedrera.com/blog/enabling-expression-engine-forms-within-magento/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>In an asp:UpdatePanel Sys.Application.add_load() = $(document).ready()</title>
		<link>http://www.pedrera.com/blog/in-an-aspupdatepanel-sys-application-add_load-document-ready/</link>
		<comments>http://www.pedrera.com/blog/in-an-aspupdatepanel-sys-application-add_load-document-ready/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 03:14:18 +0000</pubDate>
		<dc:creator>Jason Zadroga</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.pedrera.com/blog/?p=4</guid>
		<description><![CDATA[<p>Using JQuery inside an UpdatePanel can be a little tricky. The $(document).ready() is the backbone of JQuery, but it won&#8217;t be of much help when placed within an &#60;asp:UpdatePanel&#62;. Download Source (zip file) Lets say for example you need to assign an onclick handler to an &#60;asp:Button&#62; that exists within an &#60;asp:UpdatePanel&#62;. If you place the handler within the $(document).ready() function at the head of the page, the event will work up until the &#60;asp:UpdatePanel&#62; triggers a postback. Once that &#8230; <a href="http://www.pedrera.com/blog/in-an-aspupdatepanel-sys-application-add_load-document-ready/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.pedrera.com/blog/in-an-aspupdatepanel-sys-application-add_load-document-ready/">In an asp:UpdatePanel Sys.Application.add_load() = $(document).ready()</a> appeared first on <a href="http://www.pedrera.com/blog">Pedrera Philadelphia Web Design &amp; Development Blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Using JQuery inside an UpdatePanel can be a little tricky.  The $(document).ready() is the backbone of JQuery, but it won&#8217;t be of much help when placed within an &lt;asp:UpdatePanel&gt;. </p>
<p><a href="http://www.pedrera.com/blog/wp-content/uploads/2010/12/source.zip" target="_blank">Download Source (zip file)</a></p>
<p>Lets say for example you need to assign an onclick handler to an &lt;asp:Button&gt; that exists within an &lt;asp:UpdatePanel&gt;.  If you place the handler within the $(document).ready() function at the head of the page, the event will work up until the &lt;asp:UpdatePanel&gt; triggers a postback.  Once that postback occurs, because the entire page does not re-render, the event handler is lost.  </p>
<p><a href="http://www.pedrera.com/blog/wp-content/uploads/2010/12/code.gif" target="_blank"><img src="http://www.pedrera.com/blog/wp-content/uploads/2010/12/code.gif" alt="" title="asp-net-update-panel-code" width="595" height="362" class="alignleft size-full wp-image-41" /></a></p>
<p>To fix this scenario, you can use the Sys.Application.add_load() method provided by the Microsoft Ajax library.  This method acts as the $(document).ready() function within an &lt;asp:UpdatePanel&gt;  The Sys.Application.add_load() method will get triggered each time the &lt;asp:UpdatePanel&gt; postbacks and will bind all the javascript events in the same manor as $(document).ready().</p>
<p><strong>Tip</strong></p>
<p>If all of your code and controls are placed within an &lt;asp:UpdatePanel&gt; than there is no reason to initialize the page load using $(document).ready().  The Sys.Application.add_load() method will initialize everything and reassign the script when the UpdatePanel posts back.</p>
<p>The post <a href="http://www.pedrera.com/blog/in-an-aspupdatepanel-sys-application-add_load-document-ready/">In an asp:UpdatePanel Sys.Application.add_load() = $(document).ready()</a> appeared first on <a href="http://www.pedrera.com/blog">Pedrera Philadelphia Web Design &amp; Development Blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.pedrera.com/blog/in-an-aspupdatepanel-sys-application-add_load-document-ready/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the JQuery Treeview in ASP.NET</title>
		<link>http://www.pedrera.com/blog/using-the-jquery-treeview-in-asp-net/</link>
		<comments>http://www.pedrera.com/blog/using-the-jquery-treeview-in-asp-net/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 16:05:16 +0000</pubDate>
		<dc:creator>Jason Zadroga</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.pedrera.com/blog/?p=14</guid>
		<description><![CDATA[<p>Often times when building a website there will be a need for a Treeview type navigation control. In the past I have used the &#60;asp:TreeView&#62; navigation control but it can be very cumbersome and has a lot of overhead especially when it comes to styling. A better approach is to use the JQuery Treeview plugin created by Jörn Zaefferer combined with the &#60;asp:Repeater&#62; control. This will give you the same functionality of the &#60;asp:TreeView&#62; control with much more styling control &#8230; <a href="http://www.pedrera.com/blog/using-the-jquery-treeview-in-asp-net/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.pedrera.com/blog/using-the-jquery-treeview-in-asp-net/">Using the JQuery Treeview in ASP.NET</a> appeared first on <a href="http://www.pedrera.com/blog">Pedrera Philadelphia Web Design &amp; Development Blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Often times when building a website there will be a need for a Treeview type navigation control. In the past I have used the &lt;asp:TreeView&gt; navigation control but it can be very cumbersome and has a lot of overhead especially when it comes to styling.</p>
<p>A better approach is to use the <a href="http://bassistance.de/jquery-plugins/jquery-plugin-treeview/" target="_blank">JQuery Treeview plugin</a> created by Jörn Zaefferer combined with the &lt;asp:Repeater&gt; control. This will give you the same functionality of the &lt;asp:TreeView&gt; control with much more styling control and just better overall HTML code.</p>
<p><a href="http://www.pedrera.com/blog/wp-content/uploads/2010/12/treeview.zip" target="_blank">Download Source (zip file)</a></p>
<p>To begin with download the latest <a href="http://docs.jquery.com/Downloading_jQuery#Download_jQuery" target="_blank">JQuery library</a> and the <a href="http://bassistance.de/jquery-plugins/jquery-plugin-treeview/" target="_blank">JQuery Treeview plugin</a> and add those scripts to your .aspx page. There are a couple of other pieces pictured here that we will get to in a second.</p>
<p><a href="http://www.pedrera.com/blog/wp-content/uploads/2010/10/scripts.gif" target="_blank"><img src="http://www.pedrera.com/blog/wp-content/uploads/2010/10/scripts.gif" alt="" title="scripts" width="595" height="301" class="alignleft size-full wp-image-32" /></a></p>
<p>Next add a &lt;asp:Repeater&gt; for each level of navigation, in this example there are 3 levels of navigation. To make things a little more clear I am adding the &lt;ul&gt; tag to HeaderTemplate and the &lt;/ul&gt; tag to FooterTemplate. Also at the first child level I have added the OnItemDataBound handler. This will allow us to hide the subsequent &lt;asp:Repeater&gt; if it does not contain any items.</p>
<p><a href="http://www.pedrera.com/blog/wp-content/uploads/2010/10/code.gif" target="_blank"><img src="http://www.pedrera.com/blog/wp-content/uploads/2010/10/code.gif" alt="" title="jQuery Treeview in ASP.NET code" width="595" height="362" class="alignleft size-full wp-image-35" /></a></p>
<p>Then Add the javascript that will render the TreeView. In this case I want the initial state to be collapsed but when a node is selected I also want the TreeView to remember its last position and expand accordingly. I also assigned some optional animation to give the Tree a sliding effect when the nodes are expanded.</p>
<p>Finally, modify the stylesheet that comes with the <a href="http://bassistance.de/jquery-plugins/jquery-plugin-treeview/" target="_blank">JQuery Treeview plugin</a>. This demo is using arrows to symbolize the expanding and collapsing of a node. It already comes with a few nice styling options that will get you started.</p>
<p><strong>Tip</strong></p>
<p>You can also see that I wrapped everything into a &lt;div&gt; and set the display=none. This will avoid the ugly flashing of the elements when the page posts back to the server. When the page has finished loading the display attribute is removed and the tree is visible.</p>
<p>The post <a href="http://www.pedrera.com/blog/using-the-jquery-treeview-in-asp-net/">Using the JQuery Treeview in ASP.NET</a> appeared first on <a href="http://www.pedrera.com/blog">Pedrera Philadelphia Web Design &amp; Development Blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.pedrera.com/blog/using-the-jquery-treeview-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASP.NET ListView Drag and Drop reordering using JQuery</title>
		<link>http://www.pedrera.com/blog/asp-net-listview-drag-and-drop-reordering-using-jquery/</link>
		<comments>http://www.pedrera.com/blog/asp-net-listview-drag-and-drop-reordering-using-jquery/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 16:00:12 +0000</pubDate>
		<dc:creator>Jason Zadroga</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.pedrera.com/blog/?p=10</guid>
		<description><![CDATA[<p>A recent project that I have been working on, required that the user be able to rank data in any order. There a several ways to implement a reordering feature, including adding up and down arrows to each row. However, this can become tedious especially with a large table of data when an item needs to go from the bottom row to the top. A cool way to implement a reordering feature is to use the Table Drag and Drop &#8230; <a href="http://www.pedrera.com/blog/asp-net-listview-drag-and-drop-reordering-using-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.pedrera.com/blog/asp-net-listview-drag-and-drop-reordering-using-jquery/">ASP.NET ListView Drag and Drop reordering using JQuery</a> appeared first on <a href="http://www.pedrera.com/blog">Pedrera Philadelphia Web Design &amp; Development Blog</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>A recent project that I have been working on, required that the user be able to rank data in any order.  There a several ways to implement a reordering feature, including adding up and down arrows to each row.  However, this can become tedious especially with a large table of data when an item needs to go from the bottom row to the top.</p>
<p>A cool way to implement a reordering feature is to use the <a href="http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/" target="_blank">Table Drag and Drop JQuery plugin</a> created by Isocra Consulting. The plugin requires that the data be displayed in a table format. To achieve this I am using the &lt;asp:ListView&gt; control which is bound to an XML document that will act as the database and save the changes.</p>
<p><a href="http://www.pedrera.com/blog/wp-content/uploads/2010/12/drag-and-drop-source.zip" target="_blank">Download Source (zip file)</a></p>
<p>To begin with download the latest <a href="http://docs.jquery.com/Downloading_jQuery#Download_jQuery" target="_blank">JQuery library</a> and the <a href="http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/" target="_blank">JQuery Table Drag and Drop plugin</a> and add those scripts to your .aspx page.</p>
<p><a href="http://www.pedrera.com/blog/wp-content/uploads/2009/06/drag-and-drop-scripts.gif" target="_blank"><img class="alignleft size-full wp-image-20" title="drag-and-drop-scripts" src="http://www.pedrera.com/blog/wp-content/uploads/2009/06/drag-and-drop-scripts.gif" alt="" width="595" height="370" /></a></p>
<p>Next, add a &lt;asp:ListView&gt; control which will generate a clean HTML table. There are other ASP.NET server controls that render tables such as the &lt;asp:GridView&gt; control, but the &lt;asp:ListView&gt; is very flexible and more importantly does not add unnecessary HTML tags to the output.  In this example I am binding the &lt;asp:ListView&gt; to an  &lt;XmlDataSource&gt;, which can easily be replaced with a Database connection.</p>
<p><a href="http://www.pedrera.com/blog/wp-content/uploads/2009/06/drag-and-drop-code.gif" target="_blank"><img class="alignleft size-full wp-image-28" title="drag-and-drop-code" src="http://www.pedrera.com/blog/wp-content/uploads/2009/06/drag-and-drop-code.gif" alt="" width="595" height="370" /></a></p>
<p>Then, add the javascript that will handle the reordering.  This requires only a few lines of code because most of the magic takes place within the plugin.  In order to save the reordering action performed by the user, I am using a PageMethod that will call a Webservice.  The goal of the PageMethods.Reorder Webservice is to rewrite the rank attribute in the Customers.xml file according to the user selections.</p>
<p>The last step is to implement the Webservice that is responsible for saving the reordering actions. Again, I have done this with an XML Document but this can all be done with a database as well.  I used XLinq to query and update the rank attribute of Customers.xml file.  The Webservice has two parameters that are supplied by the onDropItem javascript handler, which give me the old rank order (before the item was reordered) and new rank order (where the item was reordered to).  If the old rank order is greater than the new rank order than the user moved the item up the table, otherwise it was moved down the table.</p>
<p><strong>Tip</strong></p>
<p>Another great JQuery plugin is the <a href="http://jquery.offput.ca/highlightFade/old.php" target="_blank">HightLightFade</a> plugin.  I am using this as a way to give the user feedback when the drop occurs.  Again this is very simple yet powerful and only requires one line of javascript to implement!</p>
<p>The post <a href="http://www.pedrera.com/blog/asp-net-listview-drag-and-drop-reordering-using-jquery/">ASP.NET ListView Drag and Drop reordering using JQuery</a> appeared first on <a href="http://www.pedrera.com/blog">Pedrera Philadelphia Web Design &amp; Development Blog</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.pedrera.com/blog/asp-net-listview-drag-and-drop-reordering-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
