Hi,
I have an issue when use RadAjaxManagerProxy to create loading effect and FileUpload control. Following my code:
#.aspx
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="btnImporta">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="lblStatus"/>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<div style="padding-left:10px">
<br />
<asp:Label ID="lblCaption" runat="server"
Text="Seleziona il file XML da importare: " ></asp:Label>
<asp:FileUpload ID="fileUpload" runat="server" Width="300px"/>
<br />
<br /><asp:Button ID="btnImporta" runat="server" onclick="Importa_Click" Text="Importa Dati" />
<asp:Label ID="lblStatus" runat="server"
Text=""></asp:Label>
</div>
#.cs
protected void Importa_Click(object sender, EventArgs e)
{
if (fileUpload.HasFile)
{
try
{
// Save file to tmp folder
fileUpload.PostedFile.SaveAs(TmpFile);
// Import data
ImportData();
}
catch(Exception ex)
{
}
finally
{
}
}
}
I select my file, then click on "btnImporta" button: loading image appears and click event is fired but "fileUpload.HasFile" is false. Seems that after postback fileUpload control lost its reference. I try also setting EnableViewState=false but not work.
Do you have any suggestion?
Thanks a lot in advance
I have an issue when use RadAjaxManagerProxy to create loading effect and FileUpload control. Following my code:
#.aspx
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="btnImporta">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="lblStatus"/>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<div style="padding-left:10px">
<br />
<asp:Label ID="lblCaption" runat="server"
Text="Seleziona il file XML da importare: " ></asp:Label>
<asp:FileUpload ID="fileUpload" runat="server" Width="300px"/>
<br />
<br /><asp:Button ID="btnImporta" runat="server" onclick="Importa_Click" Text="Importa Dati" />
<asp:Label ID="lblStatus" runat="server"
Text=""></asp:Label>
</div>
#.cs
protected void Importa_Click(object sender, EventArgs e)
{
if (fileUpload.HasFile)
{
try
{
// Save file to tmp folder
fileUpload.PostedFile.SaveAs(TmpFile);
// Import data
ImportData();
}
catch(Exception ex)
{
}
finally
{
}
}
}
I select my file, then click on "btnImporta" button: loading image appears and click event is fired but "fileUpload.HasFile" is false. Seems that after postback fileUpload control lost its reference. I try also setting EnableViewState=false but not work.
Do you have any suggestion?
Thanks a lot in advance