|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
post-back when the filename to upload changesHi;
Is there a way to do this? I want to get a post-back if the file to be uploaded changes. I am thinking if I have a javascript variable with the string in the filename text box. And then a javascript function is called when leaving the filename textbox or when the browse button places a new filename in the textbox – the javascript then does a post-back if the text content has changed. Would this work? And do you think it is a good way to handle this? What I show on the page depends on the content of that uploaded file. You might get answers to this in a JavaScript newsgroup.
Axel Dahmen -------- Show quoteHide quote "David Thielen" <thielen@nospam.nospam> schrieb im Newsbeitrag news:63D7F5EF-B662-41DA-BD77-FC4A9A1D4F37@microsoft.com... > Hi; > > Is there a way to do this? I want to get a post-back if the file to be > uploaded changes. I am thinking if I have a javascript variable with the > string in the filename text box. And then a javascript function is called > when leaving the filename textbox or when the browse button places a new > filename in the textbox - the javascript then does a post-back if the text > content has changed. Would this work? And do you think it is a good way to > handle this? What I show on the page depends on the content of that uploaded > file. > > -- > thanks - dave > david_at_windward_dot_net > http://www.windwardreports.com > Hi Dave,
The ASP.NET 2.0 upload control actually encapsulate the html <input type="file" name="file1" ..../> element. And if you want to do some thing when the client user change the file to upload, you can register the "onchange" client-side event of the input file element. e.g: ==================== ................ <script language="javascript"> function file_onchange(file) { alert(file.value); document.forms[0].submit(); } </script> </head> <body> <form id="form1" runat="server"> <input type="file" id="file1" name="file1" runat="server" onchange="file_onchange(this);" /> ....................... ====================== The above page use a script function to postback the page when the user change the filename o the upload html element. Hope this helps. Regards, Steven Cheng Microsoft Online Support Get Secure! www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no rights.)
How to access control in FormView
Creating N rows of controls ObjectDataSource ... could not find a non-generic method ... that has parameters: ... How to add a dropdownlist to the column header in a GridView? Custom Web control question FormView/ItemTemplate - MultiView, Radio, & checkbox Overriding Calendar.CreateChildControls Exporting Datagrid to Excel PostBack and dynamically created controls Hotspots with Images?? |
|||||||||||||||||||||||