<input id="UpBattery" runat="server" style="width: 286px" type="file" visible="false" />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Upload" Visible="False" />
Here is my .cs file,(UpBattery.PostedFile is coming NULL.
protected void Button1_Click(object sender, EventArgs e)
{
DataTable dtgridstc = (DataTable)ViewState["GridTab"];
DataTable dtGrid = dtgridstc.Clone();
lblError.Text = "";
lblSuccess.Text = "";
try
{
if (UpBattery.PostedFile.FileName.Length >= 1)
{
HttpPostedFile excelFile = UpBattery.PostedFile;
if (excelFile.FileName.ToUpper().EndsWith(".XLS") == false)
{
lblError.Visible = true;
lblError.Text = "This is not a valid Battery Details File[Not an MS Excel File]";
return;
}
Help as soon as possible
Thanks in Advance
Feel free to share informations.
mail Id ' adityagupta200@gmail.com
Thanks