<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OLEDragTest.aspx.cs" Inherits="OLEDragTest" %><!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>Untitled Page</title>
</head><script language="javascript">
    function DragEnter()
    {
        //window.event.retureValue=false;
        event.returnValue=false;
        event.cancelBubble=true;
    } 
    function DragOver()
    {
        //window.event.retureValue=false;
        event.returnValue=false;
        event.cancelBubble=true;
    } 
    function Drop()
    {
        debugger;
        var sHtml;
        var m_cfHTMLClipFormat;        m_cfHTMLClipFormat =DragControl1.GetClipboardIDForCustomFormat();
        sHtml = DragControl1.GetClipboardDataAsString0,m_cfHTMLClipFormat);        DIV1.innerHTML =sHtml;
        alert(sHtml);
    } </script>
<body>
    <form id="form1" runat="server">
    <div style="width: 218px; height: 195px; background-color: #ccffff;"  id="DIV1" ondragenter="DragEnter()" 
        ondragover="DragOver()" ondrop="Drop()">
        <object id="DragControl1" classid="clsid:6F10A99B-954C-312C-ADC8-442A63E36C8F" width=273 height=263>
        <!--param id="formatName"  value="HTML format" /--> 
        </object>
    </div>
    </form>
</body>
</html>
上面这个程序,我运行的时候总是报DragControl1未定义,实在是找不到原因了,狠急,在线等大家帮忙了。
另外DragControl1是我用vb开发的一个usercontrol,我在vs2005下开发的。
我看书上说,usercontrol就是activex,理解得没错吧。