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

Asp:FileUpload inside radpageview

5 Answers 147 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
mohamed
Top achievements
Rank 1
mohamed asked on 11 Jul 2012, 07:08 AM

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

Thanks Advance
Mohamed.

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Jul 2012, 01:56 PM
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.
0
New
Top achievements
Rank 1
answered on 12 Jul 2012, 04:12 AM
Thanks For Ur reply Princy,

Object Reference Error Comes

Thanks Advance,
Mohamed
0
mohamed
Top achievements
Rank 1
answered on 12 Jul 2012, 04:28 AM
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.
0
Princy
Top achievements
Rank 2
answered on 13 Jul 2012, 05:47 AM
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.
0
mohamed
Top achievements
Rank 1
answered on 13 Jul 2012, 06:12 AM

that the problem ajax:settings ,
Problem Solved

Thanks Advance,
Mohamed.
Tags
Upload (Obsolete)
Asked by
mohamed
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
New
Top achievements
Rank 1
mohamed
Top achievements
Rank 1
Share this question
or