Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic forms

Status
Not open for further replies.

sroberts82

Programmer
Oct 11, 2005
36
US
Hi I was just wondering if someone could help me. I have an aspx page and on the code behind page I get a variable from the database. Whatever this returned variable is, call it x. I want to have x fields on my form to upload files to the webserver. I tried using

Response.Write("<input type=\"file\" runat=\"server\" size=\"50\" id=\"file1\" name=\"file" + x + "\" />
");

And the things all show up on the page grand, but they dont seem to submit the files. They are not available on the request object on the server side. Any ideas why? or is there a better way to do this? Ive had a good hunt on the web, but still cant figure it out. Thank you again
Stephen
 
You shouldn't ever use Response.Write to write anything out to the page (for testing purposes it's OK though). Instead, try creating a new HTML control (in your case a file input control) and add to a part of your page (e.g. a panel).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanksfor that. Im trying to add stuff to the panel now, but how do I format it? Basically I just want to add basic html to it. thank you in advance,
Stephen
 
You can either create the HTML at design time and add the necessary controls at runtime, or if you really need to create HTML at runtime then try creating a new Literal control and adding the HTML to that.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top