前台页面
<% using (Html.BeginForm("ContractUpFile", "Employees", FormMethod.Post, new { enctype = "multipart/form-data" }))
{ %>
<div style="margin:0 5px 5px 20px;">
<fieldset style="height:280px; ">
<legend>上传合同信息</legend>
<p style=" position:absolute; margin-left:10px; margin-top:10px;">
<label for="upFile">选择上传合同文件:<a href="/Employees/ContractUpFileExcelDemo">下载模板</a></label>
<input type="file" name="upFile" style=" width:600px; height:25px;" /><br />
<input type="hidden" name="emp_no" id="emp_no" />
</fieldset>
</div>
<%}%>后台代码:
public ActionResult ContractUpFile(HttpPostedFileBase upFile)
{
object fileName=upFile.FileName;//获取的是上传文件的文件名,不是全路径
}
<% using (Html.BeginForm("ContractUpFile", "Employees", FormMethod.Post, new { enctype = "multipart/form-data" }))
{ %>
<div style="margin:0 5px 5px 20px;">
<fieldset style="height:280px; ">
<legend>上传合同信息</legend>
<p style=" position:absolute; margin-left:10px; margin-top:10px;">
<label for="upFile">选择上传合同文件:<a href="/Employees/ContractUpFileExcelDemo">下载模板</a></label>
<input type="file" name="upFile" style=" width:600px; height:25px;" /><br />
<input type="hidden" name="emp_no" id="emp_no" />
</fieldset>
</div>
<%}%>后台代码:
public ActionResult ContractUpFile(HttpPostedFileBase upFile)
{
object fileName=upFile.FileName;//获取的是上传文件的文件名,不是全路径
}
解决方案 »
- 页面跳转后缓存中的值丢失
- 请问对于初学者C#学到什么程度可以学习ASP.NET?
- 根据字段控制显示与否
- 问个<INPUT>File控件的问题
- 同志们:asp.net怎么知道DataGrid总共有多少页呢?
- 请问怎样将ASP.NET程序制作安装包时把.NET也一起打包进去?
- datagrid 中超链接列 能否传递所在列号?
- asp.net点击按钮,就可以吧gridview中的表内容复制到一个后台表同时删除原有数据表的内容
- 如何做一个假的Tab页!!!200分
- 好不容易建立起来的感情她家老爷子一泡尿的功夫就给我浇灭了!TMMD,害的老子白花了一个月多的精力和时间!
- gridview中如何显示图片
- 获取url问题。在线等!
希望能在你们这里明白这个获取路径的问题。
现在要实现这个功能,第一次接触,刚刚入行不久 ,所以不知道该怎么实现,之前实现是在word文档里面建了书签,后台通过书签来将要填写的内容填写到word里面,请教各位怎么实现这个功能啊!谢谢!