觉得代码是有点问题,LZ可以去查看一下HTML中对文件传送的限制document.getElementById("hid_ImportPath").value = filePath这样虽然拿到了文件路径,但没什么用只有在文件input框选择的才有效。。我记得好像是有这样的限制,具体也忘了LZ可以去查查
解决方案 »
- IE8浏览器框架里为什么不能放Google???
- MyEclipse7.0
- document write方法如何传递参数?
- jquery 悬浮框问题,各位帅哥、美女帮帮忙!
- 删除 的问题
- EXt向astruts2 action导入数据,有完整代码
- 最近 我研究 搜索引擎 (四) 中英文混合分词 V1.0正式发布(可下载)
- window.open问题,为什么页面会找不到?
- 有没有程序命令可使在网页中播放着的电影控件全屏播放呢?
- 谁能推荐一本JavaScript操纵XML的好书吗?
- 请教高手:下面javascript程序究竟哪里有错,为什么老是不行啊?
- 如何取style中设置的font-size的值?
至于你的linkbutton 如果只是用来控制div的显示 大可 改为 input button 或者 a
然后onclick事件调用div的显示控制
在div中的关闭按钮出发的时候
调用btn1按钮的onclick事件document.getElemnetById('btn1').click;
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>无标题页 </title>
<script type="text/javascript">
function setDiv(s)
{
document.getElementById("sDialog").style.display=s;
}
</script>
</head>
<body >
<form runat="server">
<a href="javascript:void(0)" onclick="setDiv('block')">显示Div</a><br>
<asp:LinkButton ID="linkBtnImport" OnClientClick="setDiv('none');return true;" ToolTip="导入Excel文件" runat="server" Text="关闭Div然后导入" OnClick="linkBtnImport_Click" ></asp:LinkButton>
<div style="width:400px;height:300px;border:solid 1px #000;display:none" id="sDialog" >
this is a div
</div>
</form>
</body>
</html> 后台
protected void linkBtnImport_Click(object sender, EventArgs e)
{
Response.Write("aaaaa");
}