-1

Could you please let me know how can I do this? any hint/sample code will be highly appreciated.

Thanks, Roop

priyanka.sarkar
  • 25,766
  • 43
  • 127
  • 173
user1500194
  • 753
  • 1
  • 6
  • 5

1 Answers1

0

There are a couple of ways you can do it, HTML5 has drag&drop (D&D) built in. You could add a data-attribute which holds the co-ordinates of the dropped element.

Data Attribute

<p id="textField" data-coords="0,0">Text</p>

<script>
// 'Getting' data-attributes using getAttribute
var textField= document.getElementById('textField');
var textCoords = plant.getAttribute('data-coords'); 

// 'Setting' data-attributes using setAttribute
textField.setAttribute('data-coords',); 
</script>

Here is a Fiddle I found on HTML5: dragover(), drop(): how get current x,y coordinates?

http://jsfiddle.net/kKuqH/2002/

You can concatenate dm.style.left + ', ' + dm.style.top

And set the concatenated value in the textField.setAttribute('data-coords', coords);

From there you can get the data-attribute in ASP.NET and post it into the database.

Just an outline.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
ZeroBased_IX
  • 2,667
  • 2
  • 25
  • 46