Windows foms control in Web page. a simple problem when with web pages
-
Hi all, I am having a winodows forms control (windows control library) which is having a list view control on to which I will drag and drop the files and the control holds their names along with the path. It is working fine when I am executing it in VS2005. I am able to drag and drop single file or multiple files at a time. But, when I am embeding it into a web page using tab, I am able to drag drop only single file at a time, it is not allowing me to drag and drop multiple files at a single go. any body have any clue? my web page code: <object id="myName" classid="http:WindowsControlLibrary1.dll#WindowsControlLibrary1.UserControl1" height="870" width="1250" align="left" name="myCtrl" /> </object> my dll code is here: private void listView1_DragDrop(object sender, DragEventArgs e) { if(e.Data.GetDataPresent(System.Windows.Forms.DataFormats.FileDrop)) { string[] files =(string[])e.Data.GetData(System.Windows.Forms.DataFormats.FileDrop); try { foreach (string s in files) { listView1.Items.Add(s.ToString()); } } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); return; } } } private void listView1_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(System.Windows.Forms.DataFormats.FileDrop)) { string[] files = (string[])e.Data.GetData(System.Windows.Forms.DataFormats.FileDrop); foreach (string s in files) { e.Effect = System.Windows.Forms.DragDropEffects.Copy; } return; } else { e.Effect = System.Windows.Forms.DragDropEffects.None; } } private void listView1_DragOver(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(System.Windows.Forms.DataFormats.FileDrop)) { string[] files = (string[])e.Data.GetData(System.Windows.Forms.DataFormats.FileDrop); foreach (string s in files) { e.Effect = System.Windows.Forms.DragDropEffects.Copy;
-
Hi all, I am having a winodows forms control (windows control library) which is having a list view control on to which I will drag and drop the files and the control holds their names along with the path. It is working fine when I am executing it in VS2005. I am able to drag and drop single file or multiple files at a time. But, when I am embeding it into a web page using tab, I am able to drag drop only single file at a time, it is not allowing me to drag and drop multiple files at a single go. any body have any clue? my web page code: <object id="myName" classid="http:WindowsControlLibrary1.dll#WindowsControlLibrary1.UserControl1" height="870" width="1250" align="left" name="myCtrl" /> </object> my dll code is here: private void listView1_DragDrop(object sender, DragEventArgs e) { if(e.Data.GetDataPresent(System.Windows.Forms.DataFormats.FileDrop)) { string[] files =(string[])e.Data.GetData(System.Windows.Forms.DataFormats.FileDrop); try { foreach (string s in files) { listView1.Items.Add(s.ToString()); } } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); return; } } } private void listView1_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(System.Windows.Forms.DataFormats.FileDrop)) { string[] files = (string[])e.Data.GetData(System.Windows.Forms.DataFormats.FileDrop); foreach (string s in files) { e.Effect = System.Windows.Forms.DragDropEffects.Copy; } return; } else { e.Effect = System.Windows.Forms.DragDropEffects.None; } } private void listView1_DragOver(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(System.Windows.Forms.DataFormats.FileDrop)) { string[] files = (string[])e.Data.GetData(System.Windows.Forms.DataFormats.FileDrop); foreach (string s in files) { e.Effect = System.Windows.Forms.DragDropEffects.Copy;
It's better if you don't use any window control in webform.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
It's better if you don't use any window control in webform.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
Hi Michael, Then how do I get similar functionality? The web controls will not allow the drag and drop functionality so, how do I achieve it? -Ram
ram1974 wrote:
The web controls will not allow the drag and drop functionality
You ca drag and drop the web control but your requirement is very strange. You want to drap and drop the file from Explore to the web page, right? Actually, it is not very good requirement for web application..
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
ram1974 wrote:
The web controls will not allow the drag and drop functionality
You ca drag and drop the web control but your requirement is very strange. You want to drap and drop the file from Explore to the web page, right? Actually, it is not very good requirement for web application..
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
Hi Michael, Yes you are right I want to drap and drop the file from Explore to the web page. Yes it may be a strange requirement. I tried my luck with web applications then later I thought to bet on mixing both the web applications and Windows, by using the windows control libarary inside the web page. When I am able to drag and drop a single file, it should allow me drag and drop multiple files also - am I right? But, it is not allowing me to drop multiple files. Am I mising something? Thank you Michael for your response..... -Ram.
modified on Thursday, December 27, 2007 3:09:55 AM
-
Hi Michael, Yes you are right I want to drap and drop the file from Explore to the web page. Yes it may be a strange requirement. I tried my luck with web applications then later I thought to bet on mixing both the web applications and Windows, by using the windows control libarary inside the web page. When I am able to drag and drop a single file, it should allow me drag and drop multiple files also - am I right? But, it is not allowing me to drop multiple files. Am I mising something? Thank you Michael for your response..... -Ram.
modified on Thursday, December 27, 2007 3:09:55 AM
I have seen that kinda features in some photos website.. but they used Flash for that.. Can you check this article? http://blog.vixiom.com/2007/06/29/merb-on-air-drag-and-drop-multiple-file-upload/[^] They said,
That's it! test your AIR app by dragging some files from the file system, once you drop them the upload progress components show a visual representation of the files, click 'upload files' and the files are upload all at once (for real real not for play play this time).
So, I think it is what you are looking for..
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
I have seen that kinda features in some photos website.. but they used Flash for that.. Can you check this article? http://blog.vixiom.com/2007/06/29/merb-on-air-drag-and-drop-multiple-file-upload/[^] They said,
That's it! test your AIR app by dragging some files from the file system, once you drop them the upload progress components show a visual representation of the files, click 'upload files' and the files are upload all at once (for real real not for play play this time).
So, I think it is what you are looking for..
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
Hi Michael, Thank you very much for your response. This is a kind of task I am looking at. But, I doubt my co., will allow me to use any third party S/w. Do, you think I can solve this problem in a any way? -Ram.
I think this is the Flex feature, right? not third-party control.... AFAIK, Flex is as same as Flash and Flex is open source one.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
I think this is the Flex feature, right? not third-party control.... AFAIK, Flex is as same as Flash and Flex is open source one.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)