Cannot drop more then 1 item on UserControl running in Internet Explorer

Discussion in 'ASP .Net' started by Johan smith, Aug 3, 2003.

  1. Johan smith

    Johan smith Guest

    What am I missing?
    I want to drag and drop multiply files onto UserControl running in Internet
    Explorer.

    1. In a Class Library Project I have added User Control
    2. Added a Label to the User Control and set the AllowDrop Property to True
    3. added the following events:

    Private Sub Label1_DragEnter(ByVal sender As Object, _
    ByVal e As
    System.Windows.Forms.DragEventArgs _
    ) Handles Label1.DragEnter
    If e.Data.GetDataPresent(DataFormats.FileDrop, False) = True Then
    e.Effect = DragDropEffects.Copy
    Else
    e.Effect = DragDropEffects.None
    End If
    End Sub

    Private Sub Label1_DragDrop(ByVal sender As Object, _
    ByVal e As
    System.Windows.Forms.DragEventArgs _
    ) Handles Label1.DragDrop
    Dim filenames() As String =
    CType(e.Data.GetData(DataFormats.FileDrop), String())
    MessageBox.Show(filenames.Length)
    End Sub

    4. added ref in asp.net to the compiled dll

    <OBJECT id="TestCtl1" classid="TestCtl.dll#testCtl.UserControl1"
    VIEWASTEXT> </OBJECT>

    The results of the DragDrop are always 1!
    While running the user control on windows application and not on Internet
    Explorer results in the correct length.

    Any help will be appreciated.
     
    Johan smith, Aug 3, 2003
    #1
    1. Advertising

  2. For me the follwing works (same scenario) in dragdrop-handler:
    Dim fileNames() As String
    fileNames = e.Data.GetData(DataFormats.FileDrop)
    ....

    Btw. How will your control be installed on other machines than yours?

    Albrecht

    "Johan smith" <> schrieb im Newsbeitrag
    news:...
    > What am I missing?
    > I want to drag and drop multiply files onto UserControl running in

    Internet
    > Explorer.
    >
    > 1. In a Class Library Project I have added User Control
    > 2. Added a Label to the User Control and set the AllowDrop Property to

    True
    > 3. added the following events:
    >
    > Private Sub Label1_DragEnter(ByVal sender As Object, _
    > ByVal e As
    > System.Windows.Forms.DragEventArgs _
    > ) Handles Label1.DragEnter
    > If e.Data.GetDataPresent(DataFormats.FileDrop, False) = True Then
    > e.Effect = DragDropEffects.Copy
    > Else
    > e.Effect = DragDropEffects.None
    > End If
    > End Sub
    >
    > Private Sub Label1_DragDrop(ByVal sender As Object, _
    > ByVal e As
    > System.Windows.Forms.DragEventArgs _
    > ) Handles Label1.DragDrop
    > Dim filenames() As String =
    > CType(e.Data.GetData(DataFormats.FileDrop), String())
    > MessageBox.Show(filenames.Length)
    > End Sub
    >
    > 4. added ref in asp.net to the compiled dll
    >
    > <OBJECT id="TestCtl1" classid="TestCtl.dll#testCtl.UserControl1"
    > VIEWASTEXT> </OBJECT>
    >
    > The results of the DragDrop are always 1!
    > While running the user control on windows application and not on Internet
    > Explorer results in the correct length.
    >
    > Any help will be appreciated.
    >
    >
    >
     
    Albrecht Scheidig, Aug 4, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cmay
    Replies:
    0
    Views:
    1,145
  2. kayodeok
    Replies:
    3
    Views:
    402
    kayodeok
    Nov 6, 2003
  3. Ed Hauptman
    Replies:
    7
    Views:
    1,032
    Ed Hauptman
    Aug 7, 2009
  4. Replies:
    0
    Views:
    304
  5. John Smith
    Replies:
    1
    Views:
    149
    Evertjan.
    Mar 12, 2005
Loading...

Share This Page