报错时的使用:
@Html.TextBoxFor(m => m.FileName, new { style = "457px;", @readonly = "readonly" }) <button class="btn" type="button" onclick="$('#attachFile').click()"><span class="fa fa-folder"></span>选择</button> <input id="attachFile" onchange="attachFileChange()" type="file" name="attachFile" style="display:none;" />
修改后的使用:
@Html.TextBoxFor(m => m.FileName, new { style = "457px;", @readonly = "readonly" })
<button class="btn" style="" type="button"><span class="fa fa-folder"></span>选择</button>
<input id="attachFile" style="position:absolute;left:0px;top:0;520px;height:100%;z-index:999;opacity:0;filter:alpha(opacity=0);-moz-opacity:0;-kh tml-opacity:0;" onchange="attachFileChange();" type="file" name="attachFile" />
修改后测试通过