I have a dynamic control in a page. It was added to this page by codebehind.
FileUpload fu = new FileUpload();
fu.ID = "fu";
fu.EnableViewState = true;
list.Add(fu);
Button btnFu = new Button();
btnFu.Text = "Upload";
btnFu.ID = "btnFu";
list.Add(btnFu);
After using postBack, I can't get the value from this fileUpload.
if (!IsPostBack) {
}
else {
string str_btn = null;
if (Request.Form.Keys[Request.Form.Keys.Count - 1] != null)
str_btn = Request.Form.Keys[Request.Form.Keys.Count - 1].ToString();
if (!string.IsNullOrEmpty(str_btn))
handleClick(str_btn);
}
Anybody has a solution to resolve this?