I am having an aspx page from which, on a button click an open file dialog should open up from which i can select a file.
i wrote the following code on the button's click event.
OpenFileDialog _filedialog = new OpenFileDialog();
_filedialog.InitialDirectory = @"C:\";
_filedialog.Title = "Add Preview Image";
_filedialog.Filter = "Image files|*.jpeg;*.jpg;*.bmp;*.png";
_filedialog.RestoreDirectory = true;
if (_filedialog.ShowDialog() == DialogResult.OK)
txtPromoPreviewImagePath.Text = _filedialog.FileName;
Now, when i run the project and click the button, hoping to see the open dialog file browser window, i see this following error.
Current thread must be set to sin
View Complete Post