Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

~~How Can I Use WindowsForm in my WebForm??~~

Mar 12 2003 6:07 AM
Can I use the windows forms in my web forms? I tried to use the 'openfiledialog' to make a dialog in my webform to do the action of selecting file instead of type the file name. But it seems doesn't work. Can anyone tell me how to do that in a C# and ASP.NET way. My code is like this: private void Button1_Click(object sender, System.EventArgs e) { dlg.AddExtension = true; dlg.CheckFileExists = true; dlg.CheckPathExists = true; dlg.DefaultExt = "cs"; dlg.Filter = "All Files (*.*)|*.*|C# Sourse Files (*.CS)|*.CS"; dlg.FilterIndex = 2; dlg.InitialDirectory = @"c:\"; dlg.RestoreDirectory = true; dlg.ShowHelp = true; dlg.Title = "Open File"; dlg.ShowDialog(); } I got a button to launch the dialog, the code looks like above, but it do not work. So I'd like somebody to tell me what is wrong with it, please. Thank you.

Answers (6)