I have the fileupload control inside gridview edittemplate:
<asp:TemplateField HeaderText="Template File" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblTemplateFileName" runat="server" Text='<%# Eval("TemplateFileName")%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:FileUpload ID="fuTemplate" runat="server" />
<asp:RequiredFieldValidator ID="rfTemplateFile" Display="Dynamic" ControlToValidate="fuTemplate"
runat="server" ErrorMessage="Select the Template File!" ValidationGroup="GRD"
Text="*" ForeColor="Red"></asp:RequiredFieldValidator>
</EditItemTemplate>
</asp:TemplateField>
GridView is inside the update panel:
<asp:UpdatePanel ID="upMain" runat="server" UpdateMode="Conditional">
<ContentTemplate>
...............
..............
</ContentTemplate>
</asp:UpdatePanel>
When through rowcommand I check fileuploader.Hasfile , and it always shows false although it has the file.
I tried having postbacktrigger for the grid as well as the fileuploader.
But it was not of use.
How can I deal with this problem?
Please guide me.
Have also tried adding :
Page.Form.Attributes.Add("enctype", "multipart/form-data");
On page load