Hi
For some reason McHtmlInputFile.PostedFile is always returning null, even though I'm selecting a file from the browser window.
I am using Version 1.6 of your upload control, the upload control works within another page but for some reason "McHtmlInputFile.PostedFile" is always returning null even after I select a file
My .aspx looks like this:
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="zzz-test04.aspx.cs" Inherits="zzz_test04" %>
<%
@ Register assembly="Mediachase.FileUploader" namespace="Mediachase.FileUploader.Web.UI" tagprefix="mc" %>
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head runat="server">
<title>Untitled Page</title>
</
head>
<
body>
<form id="form1" runat="server">
<p>
<mc:McHtmlInputFile runat="server" MaxLength="50" Size="30" Width="300px"
ID="filUploadProfilePic">
</mc:McHtmlInputFile>
<br />
<asp:Button runat="server" Text="Upload Selected Picture to our Server" CssClass="Verdana12ptBlk" Width="284px" ID="btnfileuploadProfilePic" EnableViewState="False" OnClick="btnfileuploadProfilePic_Click">
</asp:Button>
</p>
<div>
</div>
</form>
</
body>
</
html>
AND my .cs looks like this:
using
System;
using
System.Collections;
using
System.Configuration;
using
System.Data;
using
System.Linq;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.HtmlControls;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Xml.Linq;
public
partial class zzz_test04 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnfileuploadProfilePic_Click(object sender, EventArgs e)
{
string cFileNameTemp = filUploadProfilePic.PostedFile.FileName; // PostedFile is always null
string cFileExt = filUploadProfilePic.PostedFile.FileName.Substring(filUploadProfilePic.PostedFile.FileName.LastIndexOf(".") + 1);
}
}
thanks,