以下是具体代码:BasePage中
执行页面的.cs文件page_load中,加载上面的代码
this.IEGetCtrlPlace();
然后加HTML客户段控件,注意:input type=file需要添加runat="server",这样编程就可以访问到,当然,需要在.cs文件中声明:protected System.Web.UI.HtmlControls.HtmlInputFile fileAttachment;
<input class="txt-main" id="f_file" type="text" size="36" name="f_file">
<input class="btn-main" onmouseover="fileAttachmentclick(fileAttachment)" type="button" value="上传文件">
<INPUT id="fileAttachment" style="FILTER: alpha(opacity=0); WIDTH: 30px; POSITION: absolute" type="file" onchange="f_file.value=this.value" runat="server">
最后添加btn,其事件代码如下:<input class="btn-main" onmouseover="fileAttachmentclick(fileAttachment)" type="button" value="上传文件">
<INPUT id="fileAttachment" style="FILTER: alpha(opacity=0); WIDTH: 30px; POSITION: absolute" type="file" onchange="f_file.value=this.value" runat="server">