C#和#x2B;将文本拖放到图像上

C#和#x2B;将文本拖放到图像上,c#,asp.net,drag-and-drop,C#,Asp.net,Drag And Drop,你能告诉我怎么做吗?任何提示/示例代码都将受到高度赞赏 谢谢, Roop有几种方法可以实现,HTML5内置了拖放(D&D)。您可以添加一个保存被删除元素坐标的 数据属性 <p id="textField" data-coords="0,0">Text</p> <script> // 'Getting' data-attributes using getAttribute var textField= document.

你能告诉我怎么做吗?任何提示/示例代码都将受到高度赞赏

谢谢,
Roop

有几种方法可以实现,HTML5内置了拖放(D&D)。您可以添加一个保存被删除元素坐标的

数据属性

<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>
文本

//使用getAttribute“获取”数据属性 var textField=document.getElementById('textField'); var textCoords=plant.getAttribute('data-coords'); //使用setAttribute“设置”数据属性 setAttribute('data-coords',); 这是我发现的一把小提琴

您可以连接
dm.style.left+'、'+dm.style.top

并在
textField.setAttribute('data-coords',coords)中设置连接的值

从那里可以获得ASP.NET中的数据属性并将其发布到数据库中

只是一个提纲