Asp:FileUpload inside radpageview

Thread is closed for posting
6 posts, 0 answers
  1. mohamed
    mohamed avatar
    311 posts
    Member since:
    Mar 2011

    Posted 11 Jul 2012 Link to this post


    Inside radpageview
    asp:FileUpload error come on button click in
    fileup.postedfile is come null

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

    Posted 11 Jul 2012 Link to this post

    Hi mohamed,

    I suppose that you want to access the FileUpload control inside the RadPageView. Here is the sample code that I tried.

    ASPX:
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server">
          <telerik:RadPageView ID="RadPageView1" runat="server">
               <asp:FileUpload ID="FileUpload1" runat="server" />
          </telerik:RadPageView>
    </telerik:RadMultiPage>
    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" />

    C#:
    protected void Button1_Click(object sender, EventArgs e)
        {
            FileUpload FileUpload1 = (FileUpload)RadPageView1.FindControl("FileUpload1");
            string file = FileUpload1.PostedFile.ToString(); ;
        }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. New
    New  avatar
    25 posts
    Member since:
    Jul 2012

    Posted 11 Jul 2012 Link to this post

    Thanks For Ur reply Princy,

    Object Reference Error Comes

    Thanks Advance,
    Mohamed
  5. mohamed
    mohamed avatar
    311 posts
    Member since:
    Mar 2011

    Posted 11 Jul 2012 Link to this post

    Thanks For Reply Princy,


    <telerik:RadPageView runat="server" ID="PageView8">
        <div class="multipageHeight">
            <table cellpadding="0" cellspacing="0" class="tblspacer">
                <tr>
                    <td class="hdpLabel" colspan="2">
                          
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right">
                        <asp:Label ID="Label8" Text="Import :" runat="server"></asp:Label>
                    </td>
                    <td valign="top">                                                       
                        <asp:FileUpload runat="server" ID="FileUp" />
                        <asp:Button runat="server" ID="Import" Text="Import" OnClick="Import_Click" />
                    </td>
                </tr>
    My Design Page Code ,

    I'm getting filename like that but here the postedfile is come null,

    string Filepah = FileUp.PostedFile.FileName;

    Thanks Advance,
    Mohideen.
  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Jul 2012 Link to this post

    Hi Mohamed,

    Unfortunately I couldn't replicate your issue at my end. The code is working fine in telerik version 2012, 1, 215, 35.

    ASPX:
    <telerik:RadPageView ID="RadPageView1" runat="server" Selected="true">
      <div class="multipageHeight">
        <table cellpadding="0" cellspacing="0" class="tblspacer">
          <tr>
            <td class="hdpLabel" colspan="2">
            </td>
          </tr>
          <tr>
            <td colspan="2" align="right">
              <asp:Label ID="Label8" Text="Import :" runat="server"></asp:Label>
            </td>
            <td valign="top">                                                      
              <asp:FileUpload runat="server" ID="FileUp" />
              <asp:Button runat="server" ID="Import" Text="Import" OnClick="Import_Click" />
            </td>
          </tr>
        </table>
      </div>
    </telerik:RadPageView>

    C#:
    protected void Import_Click(object sender, EventArgs e)
        {
            FileUpload FileUpload1 = (FileUpload)RadPageView1.FindControl("FileUp");
            HttpPostedFile s = FileUpload1.PostedFile;
        }

    Attached is the screenshot.

    Regards,
    Princy.
  7. mohamed
    mohamed avatar
    311 posts
    Member since:
    Mar 2011

    Posted 13 Jul 2012 Link to this post


    that the problem ajax:settings ,
    Problem Solved

    Thanks Advance,
    Mohamed.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017