Jose Saiz

Jose Saiz

  • 1.5k
  • 260
  • 102.7k

FileUpload Help

May 25 2015 1:32 PM

 Hi, guys I am having a big problem with the  Visual Studio 2010 FWRK-4.0 "FileUpLoad" control when used within a "Web User Control" I can not find where the fileupload become empty or reset to null. the following is what I have in my web user control named "UploaDocumentCtrl" which I call (<@Register) within an AjaxControlToolKit "TabContainer" control 

<table>
<tr><td align="center"><asp:ValidationSummary ID="valsum2" ShowSummary="false" ShowMessageBox="true" ValidationGroup="fldReqGroup" runat="server" /></td></tr>
<tr>
<td align="right"><asp:RequiredFieldValidator ID="reqDocType" runat="server" ControlToValidate="ddlDocumenType" InitialValue="--- SELECT ---" ValidationGroup="fldReqGroup" ErrorMessage="Document type is required!"> * </asp:RequiredFieldValidator>Type:</td>
<td align="left"><asp:DropDownList ID="ddlDocumenType" runat="server">
<asp:ListItem>--- SELECT ---</asp:ListItem>
<asp:ListItem>Picture ID</asp:ListItem>
<asp:ListItem>Birth-Certificare</asp:ListItem>
<asp:ListItem>Marriage-Certificate</asp:ListItem>
<asp:ListItem>Short Form</asp:ListItem>
<asp:ListItem>Questionare</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
</asp:DropDownList></td>
<td align="right"><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtDocDesc" ValidationGroup="fldReqGroup" ErrorMessage="Document description is required!"> * </asp:RequiredFieldValidator>Description:</td>
<td align="left"><asp:TextBox ID="txtDocDesc" Width="280px" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td colspan="2" align="right"><asp:RequiredFieldValidator ID="reqScannedoc" runat="server" ControlToValidate="filUpDoc" ValidationGroup="fldReqGroup" ErrorMessage="Scanned Document is required!"> * </asp:RequiredFieldValidator>Scanned Document:</td>
<td colspan="2" align="left"><asp:FileUpload ID="filUpDoc" Width="480px" runat="server" /><asp:Button ID="btnAddNewUpload" CssClass="submit_button" Text="Add" OnClick="btnAddUpload_Click" ValidationGroup="fldReqGroup" runat="server" /></td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Literal ID="lit_UploadFile" runat="server"></asp:Literal>
</td>
</tr>
</table>

All works well to the point when I press the "ADD" Button to upload the file then the value contained in the "FilUpDoc" is lost become null I have checked the Page_Init, Page_Load and value it postback as null, like reseting the fileupload control to null value.

When I use the content from the web user control in a separate webform page it works fine, but I have to call it as a <iFrame> in order to make it work within the AjaxControlToolKit TabContainer control.

Any Idea how to fix the problem using a web control user to work within the AjaxControlToolKit TabContainer?

Thanks

 

Answers (2)