RadPanelBar and RadUpload

2 posts, 0 answers
  1. Narsing
    Narsing avatar
    4 posts
    Member since:
    Dec 2008

    Posted 20 Dec 2011 Link to this post

    Do you have an example on how to use radupload or a fileupload inside a RadPanelBar/ RadPanelItem.

    I need to get the filename uploaded using Radupload on server side code...

    Thanks.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Dec 2011 Link to this post

    Hello,

    Try the following code snippet.
    ASPX:
    <telerik:RadPanelBar ID="panel1" runat="server">
     <Items>
     <telerik:RadPanelItem runat="server">
      <ItemTemplate>
       <telerik:RadUpload ID="upload1" runat="server">
       </telerik:RadUpload>
       <asp:Button ID="btn1" runat="server" Text="Submit" OnClick="btn1_Click" />
      </ItemTemplate>
     </telerik:RadPanelItem>
     </Items>
    </telerik:RadPanelBar>

    CS:
    protected void btn1_Click(object sender, EventArgs e)
      {
          Button Button1= (Button)sender;
          RadUpload upload = (RadUpload)Button1.FindControl("upload1");
          foreach (UploadedFile f in upload.UploadedFiles)
           {
              string FileName = f.GetName();
           }
       }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top