G
Guest
Hi
1- I want to pick a file in my website project using asp.net
2- I added System.Windows.Forms by add references to my project.
3- I attach a button to my project.
4- in side Button1_Click(object sender, EventArgs e) I wrote:
OpenFileDialog filedlg = new OpenFileDialog();
filedlg.Title = "Choose an image to upload";
filedlg.InitialDirectory = @"c:\";
filedlg.Filter = "Image Files (JPG, JPEG, GIF, BMP, TIF,
PNG)|*.jpg;*jpeg;*.gif;*.bmp;*.tif;*.png|All files (*.*)|*.*";
filedlg.FilterIndex = 2;
filedlg.RestoreDirectory = true;
filedlg.ShowDialog();
but when I click on this button, I receive error.
what's wrong with my code.
thank you.
monica
1- I want to pick a file in my website project using asp.net
2- I added System.Windows.Forms by add references to my project.
3- I attach a button to my project.
4- in side Button1_Click(object sender, EventArgs e) I wrote:
OpenFileDialog filedlg = new OpenFileDialog();
filedlg.Title = "Choose an image to upload";
filedlg.InitialDirectory = @"c:\";
filedlg.Filter = "Image Files (JPG, JPEG, GIF, BMP, TIF,
PNG)|*.jpg;*jpeg;*.gif;*.bmp;*.tif;*.png|All files (*.*)|*.*";
filedlg.FilterIndex = 2;
filedlg.RestoreDirectory = true;
filedlg.ShowDialog();
but when I click on this button, I receive error.
what's wrong with my code.
thank you.
monica