views:

30

answers:

2

I have several elements in my web page generated by JavaScript. Here's an example of such content:

<input id="uploadfile01" type="file" onchange="change(1);" />
<input id="uploadfile02" type="file" onchange="change(2);" />

My question is: How can I interact with these elements in the server side, (Asp.net) after a post? (Since the elements were dynamically generated they do not exist in the original asp.net page)

A: 

I dont think that would be possible.....if i am not mistaken you want to give the option to attach multiple files. i think it would be better to place a set number of fileupload controls and set there display to none and you can use javascript to show them.

i know that this is not what you are looking for but after a postback the controls will be lost and even if they are added again they will lose there contents.(had you been generating them through code behind)

Pankaj Kumar
A: 

Found a solution to my own answer here: link

redb