It uploads the file fine but ProID is always 0, no matter which product I choose from the ddlProduct dropdownlist. I've tried using other controls including TextBox controls and they are all empty, I can't seem to reference the correct asp control values
from the AjaxFileUpload codebehind.
Louis777
Member
31 Points
201 Posts
New AjaxFileUpload Codebehind has empty asp controls
May 22, 2012 05:19 AM|LINK
Hello I have the following codebehind for the new AjaxFileUpload
protected void AjaxFileUpload_Click(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
int ProID = Convert.ToInt32(ddlProduct.SelectedValue);
string filename = (HttpContext.Current.Request.PhysicalApplicationPath) + "PropImages\\" + ProID.ToString() + "\\" + e.FileName;
AjaxFileUpload1.SaveAs(strPath);
}
It uploads the file fine but ProID is always 0, no matter which product I choose from the ddlProduct dropdownlist. I've tried using other controls including TextBox controls and they are all empty, I can't seem to reference the correct asp control values from the AjaxFileUpload codebehind.
Any suggestions are welcome.
Thanks in advance,
Louis
Mudasir.Khan
All-Star
15346 Points
3142 Posts
Re: New AjaxFileUpload Codebehind has empty asp controls
May 22, 2012 04:28 PM|LINK
place a break point and check whats the value in Request["ddlProducts"] if it exists then use that itself
Louis777
Member
31 Points
201 Posts
Re: New AjaxFileUpload Codebehind has empty asp controls
May 22, 2012 05:38 PM|LINK
Thanks for the reply,
I've placed this line on the code
string dllp = Request["ddlProperties"];
and the value of ddlp is null
It seams that I can't access any of the controls, I've also tried to update my listview1 and it does not update it
ListView1.DataBind();
What else can I try?
chetan.sarod...
All-Star
65619 Points
11118 Posts
Re: New AjaxFileUpload Codebehind has empty asp controls
May 23, 2012 03:27 AM|LINK
Refer this
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
Louis777
Member
31 Points
201 Posts
Re: New AjaxFileUpload Codebehind has empty asp controls
Jun 02, 2012 08:14 PM|LINK
Hi chetan the link you provided does not cover codebehind.
Louis777
Member
31 Points
201 Posts
Re: New AjaxFileUpload Codebehind has empty asp controls
Jun 04, 2012 09:07 AM|LINK
shafaqat309
Member
433 Points
180 Posts
Re: New AjaxFileUpload Codebehind has empty asp controls
Dec 26, 2012 11:12 PM|LINK
Hi
Were u able to solve the problem?
Visit My Blog