siva

siva

  • NA
  • 8
  • 0

How to access the file field control value in code behind

Jun 5 2008 1:32 AM

Below is my HTML View

  <mobile:Panel id="pnleSMSBody" Runat="server">
    <mobile:DeviceSpecific id="dseSMSBody" Runat="server">
     <Choice Filter="isHTML32">
       <ContentTemplate>
           <INPUT type="file" size="60" runat="server" id="File1">
      </ContentTemplate>
     </Choice>
   </mobile:DeviceSpecific>

In codebehind i tried to access the value like this

System.Web.UI.HtmlControls.HtmlInputFile FileUpload = pnleSMSBody.Content.FindControl("File1") as System.Web.UI.HtmlControls.HtmlInputFile;

i tried to find the uploaded file path like this  FileUpload.Value

but i am getting empty string vaule, please help me in solving this problem

 Thanks,

Siva