<?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>Veggerby : IBlog &#187; ASP.NET AJAX</title>
	<atom:link href="http://blog.veggerby.dk/category/aspnet/aspnet-ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.veggerby.dk</link>
	<description>Low decoupling, highly incoherent</description>
	<lastBuildDate>Fri, 28 May 2010 19:47:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Drag and Drop Control Extenders</title>
		<link>http://blog.veggerby.dk/2008/01/16/drag-and-drop-control-extenders/</link>
		<comments>http://blog.veggerby.dk/2008/01/16/drag-and-drop-control-extenders/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 21:48:07 +0000</pubDate>
		<dc:creator>nosey</dc:creator>
				<category><![CDATA[.NET General]]></category>
		<category><![CDATA[ASP.NET AJAX]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[control extender]]></category>

		<guid isPermaLink="false">http://blog.veggerby.dk/2008/01/16/drag-and-drop-control-extenders/</guid>
		<description><![CDATA[After reading Jeff Prosise&#8216;s MSDN magazine article (January 2008 edition) on Drag and Drop with ASP.NET AJAX (actually something he blogged about back in March 2007) I think the time has come to put my $0.02 on the issue. Actually it is not my $0.02 but merely a &#34;formalization&#34; of Jeff&#8217;s work. I took his [...]]]></description>
			<content:encoded><![CDATA[<p>After reading <a href="http://www.wintellect.com/cs/blogs/jprosise/">Jeff Prosise</a>&#8216;s MSDN magazine article (January 2008 edition) on <a href="http://msdn.microsoft.com/msdnmag/issues/08/01/WickedCode/default.aspx">Drag and Drop with ASP.NET AJAX</a> (actually something he <a href="http://www.wintellect.com/cs/blogs/jprosise/archive/2007/03/15/asp-net-ajax-d-d-source.aspx">blogged about</a> back in March 2007) I think the time has come to put my $0.02 on the issue. Actually it is not <u>my</u> $0.02 but merely a &quot;formalization&quot; of Jeff&#8217;s work.</p>
<p>I took his drag and drop implementation and created two <a href="http://www.asp.net/AJAX/Documentation/Live/mref/T_System_Web_UI_ExtenderControl.aspx">control</a>&#160;<a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Walkthrough/CreatingNewExtender.aspx">extenders</a>, namely a Drag Source extender and a Drop Target extender. I added functionality to allow specifying the key/value of a drag object (i.e. which object you are actually dragging) and a key/value on the drop target (i.e. knowing where you drop the object, e.g. if a drop target is inside a repeater).</p>
<p>Usage is extremely simple. As always simply point the DragSourceExtender and/or DropTargetExtender to an ASP.NET Server Control (this is the &quot;limitation&quot;, it must be a server side control), set the DragType, DropType, DragValue and DropValue as required and create a callback method in the OnClientDrop &quot;event handler&quot;/callback on the drop target.</p>
<p>The callback signature is:</p>
<div class="vscode"><span style="color: #008000">/// &lt;summary&gt;     <br />/// Client-side drop event handler/callback method signature      <br />/// &lt;/summary&gt;      <br />/// &lt;param name=&quot;sender&quot; type=&quot;Veggerby.DropTargetBehavior&quot; domElement=&quot;false&quot;&gt;      <br />/// The DOM element the drop is associated with      <br />/// &lt;/param&gt;      <br />/// &lt;param name=&quot;e&quot; type=&quot;Veggerby.DropEventArgs&quot; domElement=&quot;false&quot;&gt;      <br />/// EventArgs for the drop operation, includes references to DragSource and DropTarget      <br />/// &lt;/param&gt;      <br /><span style="color: #0000ff">function</span> OnClientDrop(sender, e)       <br />{      <br />}</span></div>
<p>Future enhancements could/would include allowing a service call on a successful drop, however currently this can be (easily) achieved manually in an OnClientDrop callback.</p>
<p><a href="http://blog.veggerby.dk/wp-content/uploads/2008/01/veggerbywebcontrols.zip">Download the source code here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veggerby.dk/2008/01/16/drag-and-drop-control-extenders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
