This is a migrated thread and some comments may be shown as answers.

how to avoid postback during file upload?

1 Answer 104 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Imthiyas
Top achievements
Rank 1
Imthiyas asked on 17 Dec 2008, 03:32 PM
Hai All,

        I am using fileupload inside Radgrid.I have several tabs in my page.but while using document upload page in the application,It is doing a postback.I would like to know about how to avoid this post back in my page.here is the code which i used in my application:

 
 aspx page: 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" ClientEvents-OnRequestStart="conditionalPostback"> 

 <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />  

 

 

 

 <telerik:RadGrid ID="RGDocuments"   

<PagerStyle Mode="NextPrevAndNumeric" />  

<MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="PKID,DocumentType,DocumentName,UploadedTime,DocumentExpiryDateFlag,DocumentExpiryDate">  

<Columns> 

<telerik:GridTemplateColumn HeaderButtonType="TextButton" UniqueName="Upload" HeaderText="File Name">  

 

<ItemTemplate  

<asp:Label runat="server" ID="lblFileName" Text='<%# Eval("FileName") %>' />     

</ItemTemplate  

<EditItemTemplate  

<asp:FileUpload Width="400" BorderColor="AliceBlue" onclick="return Check()" ID="RadUpload1"  runat="server" />   

</EditItemTemplate>   

</telerik:GridTemplateColumn> 

 

</Columns>   

</MasterTableView 

</telerik:RadGrid>

aspx.cs Code  

 

protected void RGDocuments_ItemDataBound(object sender, GridItemEventArgs e)  

{ 

 

FileUpload upload = (FileUpload)e.Item.FindControl("RadUpload1"); 

RadAjaxPanel1.ResponseScripts.Add(string.Format("window['UploadId'] = '{0}';", upload.ClientID)); 

 

 

}

 

 

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 17 Dec 2008, 03:38 PM
Hello Imthiyas ,

To upload a file you need to postback. There is no workaround for the time being. Check this help article for additional info.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Upload (Obsolete)
Asked by
Imthiyas
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or