473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

OPENFILEDIALOG ??

Im trying to do this from ASP.NET and it does not work.

Dim ofd As New OpenFileDialog

Openfiledialog is not there.

But I can find it in the object browser.

In my web config i can see this
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

What am i missing to use that openfiledialog?
Feb 6 '06 #1
5 1835
KMA
where are you expecting to see the openfiledialog? On the client? On the
server???
"De kessé" <De*****@anonyme.com> wrote in message
news:yN******************@wagner.videotron.net...
Im trying to do this from ASP.NET and it does not work.

Dim ofd As New OpenFileDialog

Openfiledialog is not there.

But I can find it in the object browser.

In my web config i can see this
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

What am i missing to use that openfiledialog?

Feb 6 '06 #2
ok I found it but I am getting a thread error on showdialog

error msg:

"Current thread must be set to single thread apartment (STA) mode before OLE
calls can be made. Ensure that your Main function has STAThreadAttribute
marked on it. This exception is only raised if a debugger is attached to the
process."

code:

Dim ofd As New Windows.Forms.OpenFileDialog

ofd.Filter = "Text files (*.txt)|*.txt|" & "All files|*.*"

If ofd.ShowDialog() Then
End If

"De kessé" <De*****@anonyme.com> wrote in message
news:yN******************@wagner.videotron.net...
Im trying to do this from ASP.NET and it does not work.

Dim ofd As New OpenFileDialog

Openfiledialog is not there.

But I can find it in the object browser.

In my web config i can see this
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

What am i missing to use that openfiledialog?

Feb 6 '06 #3
This is ASP.NET !!

"De kessé" <De*****@anonyme.com> schreef in bericht
news:17******************@wagner.videotron.net...
ok I found it but I am getting a thread error on showdialog

error msg:

"Current thread must be set to single thread apartment (STA) mode before
OLE calls can be made. Ensure that your Main function has
STAThreadAttribute marked on it. This exception is only raised if a
debugger is attached to the process."

code:

Dim ofd As New Windows.Forms.OpenFileDialog

ofd.Filter = "Text files (*.txt)|*.txt|" & "All files|*.*"

If ofd.ShowDialog() Then
End If

"De kessé" <De*****@anonyme.com> wrote in message
news:yN******************@wagner.videotron.net...
Im trying to do this from ASP.NET and it does not work.

Dim ofd As New OpenFileDialog

Openfiledialog is not there.

But I can find it in the object browser.

In my web config i can see this
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

What am i missing to use that openfiledialog?


Feb 6 '06 #4
Keep in mind that your code runs server side i.e. at best it would open this
server side where it is useless...

If your goal is to upload a file use the htmlInputFile control (or the
FileUpload control).

If this is not an ASP.NET application, try a Windows Forms group.
--
Patrice

"De kessé" <De*****@anonyme.com> a écrit dans le message de
news:yN******************@wagner.videotron.net...
Im trying to do this from ASP.NET and it does not work.

Dim ofd As New OpenFileDialog

Openfiledialog is not there.

But I can find it in the object browser.

In my web config i can see this
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

What am i missing to use that openfiledialog?

Feb 6 '06 #5
yes vs 05

"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43**********************@text.nova.planet.nl. ..
This is ASP.NET !!

"De kessé" <De*****@anonyme.com> schreef in bericht
news:17******************@wagner.videotron.net...
ok I found it but I am getting a thread error on showdialog

error msg:

"Current thread must be set to single thread apartment (STA) mode before
OLE calls can be made. Ensure that your Main function has
STAThreadAttribute marked on it. This exception is only raised if a
debugger is attached to the process."

code:

Dim ofd As New Windows.Forms.OpenFileDialog

ofd.Filter = "Text files (*.txt)|*.txt|" & "All files|*.*"

If ofd.ShowDialog() Then
End If

"De kessé" <De*****@anonyme.com> wrote in message
news:yN******************@wagner.videotron.net...
Im trying to do this from ASP.NET and it does not work.

Dim ofd As New OpenFileDialog

Openfiledialog is not there.

But I can find it in the object browser.

In my web config i can see this
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

What am i missing to use that openfiledialog?



Feb 6 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jody Gelowitz | last post by:
VS.NET 2002 and 2003 are installed. ..NET Framework 1.0 and 1.1 installed Program running under VisualBasic.NET 2002 with .NET Framwork 1.0 I am experiencing a problem with ADO.NET where the...
3
by: bobrad | last post by:
MAYBE SOMEBODY CAM HELP I AM USING THE FOLLOWING CODE TO GET A LOCATION OF A FILE IN A WINFORM DIALOG OpenFileDialog openFileDialog = new OpenFileDialog(); OpenFileDialog.Filter = " Access...
2
by: don | last post by:
has anyone experienced problems with interactions between OpenFileDialog and FileStream? When I select "open" from an OpenFileDialog the subsequent calls to FileStream do not create a file. If I do...
4
by: Nagachandra Sekhar Grandhi | last post by:
I am facing a problem with OpenFileDialog. It is as follows. I opened OpenFileDialog dialog box and selected a folder in it. After selecting the folder when i tried to delete the same folder in...
8
by: e-mid | last post by:
why does not openFileDialog have closed event? i want to do something; as soon as the dialog closes. is there a way to do this?
6
by: barbara_dave | last post by:
Hi, All, I want to use the openfiledialog to open different extension files in different directory( only one type files at one time). I set the OpenFiledialog InitialDirectory and Filter...
8
by: marcus.kwok | last post by:
I am having a weird problem and I have can't figure out why it is happening. I create an OpenFileDialog and set a filename filter. When the dialog first opens, the filter works correctly, and...
1
by: sam | last post by:
OpenFileDialog appears to be "holding onto" the parent folder of a selected file until the application using the dialog quits. After creating a folder containing a file, I attempted to select...
3
by: Martijn Mulder | last post by:
It strikes me that System.Windows.Forms.OpenFileDialog seems te 'remember' which directory it was in last, even when a new OpenFileDialog-object is created for every access to the file system....
0
by: mbewers1 | last post by:
Hi I'm having a problem trying to get a customised OpenFileDialog() to fulfil my requirements. The code for this custom-built dialog has been taken from another site...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.