first time asking a question here.
I’m making a DNN module and in the Setting.ascx I’m trying to add any form of FileUpload in there. I’m successful at adding ASP’s FileUpload as well as Telerik’s RadUpload, but when I click a button I added to save and examine the uploaded the file it’s empty and no longer holding any data. I thought I was coding it wrong at first, but after adding it into the View.ascx instead it works perfectly. Of course that’s not where I want it to be.
I believe the problem might be how the Setting.ascx works in DNN. I believe it’s using a form of AJAX to display it so that might be interfering. Hard to say though. While I’m at it can anyone confirm that Setting.ascx is using AJAX and that button clicks cause asynchronous postbacks? Thanks.
You’re right with your thought that the form uses AJAX (formerly via
UpdatePanel, now viaRadAjaxPanelin DNN 6.x), and that’s what’s interfering with the upload. In most scenarios, you’d just switch to a regular postback by callingScriptManager.RegisterPostBackControl, but in the settings case, you don’t have a direct reference to theLinkButtonthat saves the settings.You’ll probably need to add your own button to the form to do the upload after the user has selected the file. DNN’s own
UrlControluses a system like that, where there’s an Upload button next to the Browse button. DNN also has a newerDnnFilePickercontrol, which might also encapsulate what you want. You’ll just need to add an@ Registerdirective to use those. For example: