I have an HTML input and a WebUpload control on a page. How can I get a value from the input control in the OnUploadStarting and OnUploadFinishing events?
Hello,
You should be able to get the value of the input as you normally would, for example:
var value = document.getElementById("inputId").value;
Please let me know if you have any other questions.
How can I access the page control in OnUploadFinishing server event? For example:protected void webUpload1_OnUploadFinishing(object sender, UploadFinishingEventArgs e) { // I need to get page control values here. }
Thanks in advance.
Hi,
You can access the value of a html input from the Request object by its name value. For example, if you have input with name="text1", on the server you can get its value like this: Request.Form["text1"].
Let me know if this helps.
Thanks for your reply, but I cannot do this because OnUploadFinished event of WebUpload control is called via AJAX, not postback.
Could you please provide an example? A Web page with 2 controls: WebUpload and HTML input. In the OnUploadFinished server event please append actual value from HTML input to the name of the uploaded file.
Hi mikenash,
You are right.
It seems that it is not possible to get the textbox value on the server because it is not posted in the async request.