Intersoft WebDesktop Documentation
How-to: Enable AJAX callback and perform server side tasks upon drag drop
See Also Send Feedback
Intersoft WebDesktop > WebDragDropExtender > Concepts > AJAX DragDrop Server Side Event > How-to: Enable AJAX callback and perform server side tasks upon drag drop

Glossary Item Box

You can enable AJAX callback using WebDragDropExtender.NET V1.0.

This topic will show you how to enable AJAX callback and perform server side tasks using drag drop.

To enable AJAX callback

  1. Select a WebDragDropExtender instance, then press F4 to display the property window.
  2. Expand DropSettings.
  3. Set AutoPostBackOnDragDrop to Yes.
  4. Set PostBackMode to FlyPostBack.


The declarative markup sample:

Component's Tags Copy Code
<ISWebDesktop:WebDragDropExtenderID="WebDragDropExtender1" runat="server"> 
<DragControls>
<ISWebDesktop:WebDragControl ControlID="Panel1" DragData="Hello" />
</DragControls>
<DropControls>

<ISWebDesktop:WebDropControl ControlID="Panel3" />
</DropControls>
<DropSettings AutoPostBackOnDragDrop="Yes" PostBackMode="FlyPostBack" />
</ISWebDesktop:WebDragDropExtender>


To perform server side tasks upon drag drop

  1. Click Events in the Property Window's command bar.
  2. Double click on the DragDrop event.


As soon as you double click the DragDrop event, you will be taken to the code window as shown in the following image.

Finally, write your own codes to handle business logics according to the drag-drop context available in the event argument.

C# sample codes:

C# Copy Code

protected void WebDragDropExtender1_DragDrop(object sender, ISNet.WebUI.WebDesktop.WebDragDropEventArgs e)
{
string s = "This data is sent back from server side through FlyPostBack (AJAX) call.<br/><br/>";


s +=
"The event argument data:";
s +=
"&lt;br/>- DragSource ID: <i>" + e.DragControl.ControlID + "&lt;/i>";
s +=
"&lt;br/>- DragData: <i>" + e.Data.ToString() + "&lt;/i>";
s +=
"&lt;br/>- Effect: <i>" + e.Effect.ToString() + "&lt;/i>";
s +=
"&lt;br/>- EffectText: <i>" + e.EffectText.ToString() + "&lt;/i>";
s +=
"&lt;br/>- KeyState: <i>" + e.KeyState.ToString() + "&lt;/i>";
s +=
"&lt;br/>- X: <i>" + e.X.ToString() + "&lt;/i>";
s +=
"&lt;br/>- Y: <i>" + e.Y.ToString() + "&lt;/i>";


Panel4.Controls.Add(
new LiteralControl(s));
WebDragDropExtender1.ClientAction.RenderControl(Panel4);
}

See Also

© 2012 Intersoft Solutions Corp. All Rights Reserved.