G
Guest
Within a form in an application I have section where the user selects the
number of files they need to upload. Using Javascript I right the
HtmlFileInput boxes within span element on the page. I have an object that I
wrote that will accept the HttpPostedFile and do some processing. However, I
get an "Object reference not set to an instance of an object" on the postback
when I try to reference one of the input fields.
I realized this is because the controls were not part of the controls
collection when the page loaded. If I do a Request.Files I get 0.
Does anyone have any idea how I can use a Javascript function to write
htmlfileinput controls to a page and then get the request.files collection on
postback when the user clicks a submit button? Note: This file upload section
is contained within a form with several other fields (webform controls) that
must be processed also.
I really want to avoid a postback on selectedindexchanged on the
dropdownlist that the user selects the number of files.
Thanks a bunch.
number of files they need to upload. Using Javascript I right the
HtmlFileInput boxes within span element on the page. I have an object that I
wrote that will accept the HttpPostedFile and do some processing. However, I
get an "Object reference not set to an instance of an object" on the postback
when I try to reference one of the input fields.
I realized this is because the controls were not part of the controls
collection when the page loaded. If I do a Request.Files I get 0.
Does anyone have any idea how I can use a Javascript function to write
htmlfileinput controls to a page and then get the request.files collection on
postback when the user clicks a submit button? Note: This file upload section
is contained within a form with several other fields (webform controls) that
must be processed also.
I really want to avoid a postback on selectedindexchanged on the
dropdownlist that the user selects the number of files.
Thanks a bunch.