My DNN module page only contains some divs and a LinkButton. The contents of the div are populated using jQuery AJAX. The button is used to post a file to the server that needs to be uploaded. I am getting the "Invalid postback or callback argument" error.
Assuming event validation cannot be turned off, from what I have read till now, I am not supposed to modify contents of any server controls on the page using javascript, and if I do then I have to user RegisterForEventValidation to register all possible postback data for that control beforehand. I am not sure if that applies in my case since there are no server controls that are being modified. Is there a problem with my approach for uploading files when rest of the content is all loaded through AJAX?
<div id="divTop"></div>
<div id="divMain"></div>
<div id="divError" style="display: none" class="ui-widget-content ui-state-error"></div>
<div id="divAddFile"></div>
<div id="divSearchNow" class="ui-widget-header divControl" style="position: absolute; display: none; z-index: 999;"></div>
<asp:LinkButton ID="btnUploadFiles" runat="server" OnClick="btnUploadFiles_Click"
Style="display: none;">Upload Files</asp:LinkButton>
To enable the user to upload, an html file control is rendered and the button is made visible, both through AJAX/javascript. However, I get an error when the page attempts a postback.
Most of the examples I have seen till now mention dropdowns that are manipulated through javascript, and hence RegisterForEventValidation is used on all dynamic values. How can I apply this to my situation?
I am also open to suggestions on the approach I am taking for file uploads on a page that is rendered almost entirely through AJAX. Thanks in advance!