access other controls from within fileuploader event

Nov 19, 2008 at 2:13 PM

Me again lol. I've read the docs and got it all working now. Love the control ! Now I have a question concerning accessing other controls.

I have written my own FileReceived to save the file to a database. Problem is I need to pass 5 more variables to the database while saving.
eg. I have 3 DropDownLists & 2 Textboxes & 1 FileUploader control.

I need to access the content from the textboxes & the selectedvalue in the FileReceived method for processing the file.

Simple example: would be: they fill in their first name in one textbox, their last name in the second textbox.
In the FileReceive method I then use e.File.SaveAs("C:\\temp\\" + txtBox1.Text + "_" + txtBox2.Text). But I can't retrieve the contents of any control on the page.

Is there any workaround ? I've tried with the State.Add but it only allows me to add one value as a string.

Thanks in advance !
Nov 19, 2008 at 4:18 PM
First of all you can have more than one value in state. As

and then get it as this.Context.Request["Key1"] and this.Context.Request["Key2"]

or if you want to have access to all the controls do that: