![]() |
| ||
| Open file Dialog in asp.net Hi all, I want to have a button in a page like 'open File'. on which if user clicks, it should open open file dialog box to select a file and as soon as he clicks on the open button it should open the file (in same window or different window) I tried using the "FileUpload 'Button but it comes in combination along textbox and button. but i need only button. I tried <input id="file1" Type="File" runat="server"/> in html view this is also the same thing can anybody help me such that on button click it should open file select dialog box on local machine(where the user is accessing )select file and open it. i know how to do it in windows app but i need to do it in web app. Thanks in advance Naresh |
| ||
| Re: Open file Dialog in asp.net you cant hide the textbox but if you set the display style property of the FORM element to 'none' and create another element of type button then using javascript you can open the dialog onClick of the button e.g. <form name="form1"/> |
| ||
| Re: Open file Dialog in asp.net Quote:
I had already done it upto that extent(of which i am able to get path of the file into textbox(which is not visible)but with more number of lines)ok. but now what my question is that after opening the 'Choosefile'dialog onClick of button('browse') and select one (ex:- *.xml) file ->click on 'Open' button on 'Choosefile'dialog .then it should open that file in a new browser or some editor. |
| ||
| Re: Open file Dialog in asp.net ok then just simply add an onchange event to your FILE input. <form name="form1"/>the above code will open the path of the file in a new browser window. be aware this is only supported by I.E.6 + mozilla 1.5+ i believe as the onchange event in an INPUT of type file never used to work. |
| ||
| Re: Open file Dialog in asp.net No it did'nt worked ..... Attribute 'onchange' is not a valid attribute of element 'input'..... |
| ||
| Re: Open file Dialog in asp.net ok i did it but not as per requirement with one textbox for selecting path with button and another to display the file |
| All times are GMT -4. The time now is 3:03 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC