File Open Dialog Control (GetOpenFileNameA) not opens in ASP.NET
Hi All,I have .aspx page 2.0 with Open Dilalog Control using
GetOpenFileNameA(with a textbox and Button). If i run the application and by pressing the button the File Open Dialog Control opens and i could able to use it.I published the website and when iam trying to run the page with the URL the File Open Dialog control is not opening up when i clicked on the Button (it hangs). Is there any limitation withGetOpenFileNameA or is there any workaround to come out of this problem.
I have a question regarding "GetOpenFileNameA", will the File Open Dialog works with Client when executed through the browser.?
Thanks & Regards,
Sreenivas Kaushik
You can not use Windows controls (including the open dialog) on a web page. It doesn't make any sense because the code is running on the server so you'd never see it in the browser (which is just a raw stream of text).
To open a dialog like that on the client you'll have to either use a server control that supports it or resort to client-side script. However most browsers have effectively locked down client-side scripting of this feature for security reasons. The HtmlInputFile can be used for the actual input file field. Refer to the following link for an example of how to get this to work on the client: http://www.codeproject.com/aspnet/fileupload.asp
BTW please post ASP.NET questions in the ASP.NET forums rather than in the MSDN forums. You'll get a quicker response there. Thanks.
Michael Taylor - 6/1/07
http://p3net.mvps.org