Tuesday, June 15, 2010

Fileupload inside UpdatePanel

I have a updatepanel in the master-page and fileupload control in the content page where it was not working despite my use of trigger
The I did the following trick
Step 1:
In the code file of the master page I did the following
public void RegisterPostbackTrigger(Control fullPostBack)
{
ScriptManager1.RegisterPostBackControl(fullPostBack);
}
Step 2:
In the HTML code of the content page I had following lines
Step 3:
Inside the page load event of content page I did the following
protected void Page_Load(object sender, EventArgs e)
{
try
{
((ASP.pages_admin_master_master)Page.Master).RegisterPostbackTrigger(btnUpload);

}
catch
{
}
}

No comments: