Saturday, March 24, 2012

A Simple Drag & Drop problem

Hello, I'm learning Atlas and I wrote the following code for a drag and drop issue. It doesn't work so, help me to correct this code.

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="FirstDragAndDrop.aspx.cs" Inherits="FirstDragDrop" %>"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >First Drag and Drop"server"> "text/css" rel="Stylesheet" href="FirstDragAndDropSS.css" /> "form1" runat="server"> true ID="ScriptManager" runat="server"> "ScriptLibrary/AtlasCompat.js" Browser="Firefox" /> "ScriptLibrary/AtlasUIDragDrop.js" />

class="header">Drag & Drop Example

class="main">

class="up">

class="login" id=log>

class="loginHandle">Login

class="loginContent"> "Login" runat="server">

class="calendar" id=cal>

class="calendarHandle">Calendar

class="calendarContent"> "Calendar1" runat="server">

class="down" id="dropzone">

"dropCueTemplate"class="dropCue">

Thanks

"text/xml-script"> "ScriptLibrary/AtlasUI.js"/> "ScriptLibrary/AtlasControls.js"/> "ScriptLibrary/AtlasUIDragDrop.js"/> "dropzone"> "HTML" acceptedDataTypes="'HTML'" dragMode="Move" direction="Vertical"> "dropCueTemplate"/> "log"> "loginHandle" dataType="HTML"/> "cal"> "calendarHandle" dataType="HTML"/>
the source isn't posted correctly... can't help soz!
I don't know how to do for the post to be better. I'll try to do it better.

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="FirstDragAndDrop.aspx.cs" Inherits="FirstDragDrop" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>First Drag and Drop</title>
<link type="text/css" rel="Stylesheet" href="FirstDragAndDropSS.css" />
</head>
<body>
<form id="form1" runat="server">
<atlas:ScriptManager EnablePartialRendering=true ID="ScriptManager" runat="server">
<Scripts>
<atlas:ScriptReference Path="ScriptLibrary/AtlasCompat.js" Browser="Firefox" />
<atlas:ScriptReference Path="ScriptLibrary/AtlasUIDragDrop.js" />
</Scripts>
</atlas:ScriptManager>
<div class="header">Drag & Drop Example</div>
<div class="main">
<div class="up">
<div class="login" id=log>
<div class="loginHandle">Login</div>
<div class="loginContent">
<asp:Login ID="Login" runat="server">
</asp:Login>
</div>
</div>
<div class="calendar" id=cal>
<div class="calendarHandle">Calendar</div>
<div class="calendarContent">
<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
</div>
</div>
</div>
<div class="down" id="dropzone">
<div id="dropCueTemplate" class="dropCue"></div>
</div>
</div>
<script type="text/xml-script">
<page>
<references>
<add src="ScriptLibrary/AtlasUI.js" />
<add src="ScriptLibrary/AtlasControls.js" />
<add src="ScriptLibrary/AtlasUIDragDrop.js" />
</references
<components>
<control id="dropzone">
<behaviors>
<dragDropList dataType="HTML" acceptedDataTypes="'HTML'" dragMode="Move" direction="Vertical">
<dropCueTemplate>
<template layoutElement="dropCueTemplate" />
</dropCueTemplate>
</dragDropList>
</behaviors>
</control
<!--Draggable Items--> <control id="log">
<behaviors>
<draggableListItem handle="loginHandle" dataType="HTML" />
</behaviors>
</control
<control id="cal">
<behaviors>
<draggableListItem handle="calendarHandle" dataType="HTML" />
</behaviors>
</control
</components>
</page
</script>
</form>
</body>
</html>

This looks like a sample for an older build. Here's a similar sample that works with the March CTP:

 <atlas:ScriptManagerProxy runat="server" ID="scriptManagerProxy"> <Scripts> <atlas:ScriptReference ScriptName="AtlasUIDragDrop" /> </Scripts> </atlas:ScriptManagerProxy> <div class="shim column"></div> <div class="page" id="links"> <div id="content"> <h2>Atlas.UI.DragDrop</h2> <p>This file contains script that demonstrates the drag & drop functionality.</p> <div class="dragDrop"> <div style="visibility:hidden; display:none"> <ul> <li id="dropCueTemplate" style="border-top: 1px solid #000" /> <li id="emptyHostTemplate">No draggables in this host.</li> </ul> </div> Zone 1 <ul id="zone1"> <li id="item1"> <div class="draggableFrame"> <div id="item1handle" class="handle"> <span class="handleText">Draggable 1.1</span> </div> <div id="item1data" class="draggableBody"> Draggable list item 1 from zone 1 </div> </div> </li> <li id="item2"> <div class="draggableFrame"> <div id="item2handle" class="handle"> <span class="handleText">Draggable login</span> </div> <div id="item2data" class="draggableBody"> <asp:Login ID="Login1" runat="server" /> </div> </div> </li> </ul> Zone 2 <ul id="zone2"> <li id="item3"> <div class="draggableFrame"> <div id="item3handle" class="handle"> <span class="handleText">Draggable 2.1</span> </div> <div class="draggableBody"> Draggable list item 1 from zone 2 </div> </div> </li> <li id="item4"> <div class="draggableFrame"> <div id="item4handle" class="handle"> <span class="handleText">Draggable 2.2</span> </div> <div class="draggableBody"> Draggable list item 2 from zone 2 </div> </div> </li> <li id="item5"> <div class="draggableFrame"> <div id="item5handle" class="handle"> <span class="handleText">Calendar</span> </div> <div> <asp:Calendar ID="Calendar1" runat="server" /> </div> </div> </li> </ul> </div> </div> </div> <script type="text/xml-script"> <page xmlns:script="http://schemas.microsoft.com/xml-script/2005"> <components> <control id="zone1"> <behaviors> <dragDropList dataType="HTML" dragMode="Move" acceptedDataTypes="'HTML'"> <dropCueTemplate> <template layoutElement="dropCueTemplate" /> </dropCueTemplate> <emptyTemplate> <template layoutElement="emptyHostTemplate" /> </emptyTemplate> </dragDropList> </behaviors> </control> <control id="item1"> <behaviors> <draggableListItem handle="item1handle" /> </behaviors> </control> <control id="item2"> <behaviors> <draggableListItem handle="item2handle" /> </behaviors> </control> <control id="zone2"> <behaviors> <dragDropList dataType="HTML" dragMode="Move" acceptedDataTypes="'HTML'"> <dropCueTemplate> <template layoutElement="dropCueTemplate" /> </dropCueTemplate> <emptyTemplate> <template layoutElement="emptyHostTemplate" /> </emptyTemplate> </dragDropList> </behaviors> </control> <control id="item3"> <behaviors> <draggableListItem handle="item3handle" /> </behaviors> </control> <control id="item4"> <behaviors> <draggableListItem handle="item4handle" /> </behaviors> </control> <control id="item5"> <behaviors> <draggableListItem handle="item5handle" /> </behaviors> </control> </components> </page> </script>

Is it possible to retain these postions for the widgets when the user logs in for the second time.

manjunath

No comments:

Post a Comment