如何在asp.net中点击按纽后弹出保存文件对话框(vb.net) 各位大侠看看 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如何在asp.net中点击按纽后弹出保存文件对话框(vb.net) 使用html的控件File Field 即 <INPUT style="Z-INDEX: 101; LEFT: 248px; POSITION: absolute; TOP: 192px" type="file">html代码如下:<%@ Page language="c#" Codebehind="WebForm2.aspx.cs" AutoEventWireup="false" Inherits="TestWebApp.WebForm2" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML> <HEAD> <title>WebForm2</title> <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" Content="C#"> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> </HEAD> <body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <FONT face="宋体"><INPUT style="Z-INDEX: 101; LEFT: 248px; POSITION: absolute; TOP: 192px" type="file"></FONT> </form> </body></HTML>测试通过 也可以使用javascript代码如下:<html><head><meta http-equiv="Content-Language" content="zh-cn"><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta name="GENERATOR" content="Microsoft FrontPage 4.0"><meta name="ProgId" content="FrontPage.Editor.Document"><title>New Page 1</title></head><SCRIPT LANGUAGE="javascript">function SaveFile(){ try { var xlsWindow = window.open("","_blank","left=-1,top=-1,width=100,height=100"); xlsWindow.document.execCommand('Saveas',true,'%homeDrive%\\new_file.txt') xlsWindow.close(); } catch(e) {}}</script><body><form> <input type="button" value="button" onclick="SaveFile()" ID="Button1" NAME="Button1"></form></body></html>测试通过 function SaveFile() { document.execCommand('Saveas',true,'% } 关于dropdownlist取值的问题 两个页面之间传值,这种情况下用哪种方式好? 新手问题,关于表格的显示位置 网页中的快捷键设置问题 请问有人装过exchange server 2003吗? 请孟子E章老师帮忙,发了三个帖子了,没人回答,看过您给别人回复过类似的问题 公司面试题目 快!急~~~~~急~~~~急!!! 有可能是ie的版本的问题导致page_load事件执行两次? 在 ASP。NET 里面怎么进行定时! 请问怎样判断文件夹是否为空? 请问用VS.NET 2003自带的水晶报表时,在实现导出时,如何实现保存路径的选择? 类库输出类型项目的调试问题!!!
即 <INPUT style="Z-INDEX: 101; LEFT: 248px; POSITION: absolute; TOP: 192px" type="file">html代码如下:
<%@ Page language="c#" Codebehind="WebForm2.aspx.cs" AutoEventWireup="false" Inherits="TestWebApp.WebForm2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm2</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋体"><INPUT style="Z-INDEX: 101; LEFT: 248px; POSITION: absolute; TOP: 192px" type="file"></FONT>
</form>
</body>
</HTML>测试通过
代码如下:<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<SCRIPT LANGUAGE="javascript">
function SaveFile()
{
try
{
var xlsWindow = window.open("","_blank","left=-1,top=-1,width=100,height=100");
xlsWindow.document.execCommand('Saveas',true,'%homeDrive%\\new_file.txt')
xlsWindow.close();
}
catch(e)
{}
}</script>
<body>
<form>
<input type="button" value="button" onclick="SaveFile()" ID="Button1" NAME="Button1">
</form>
</body>
</html>测试通过
{ document.execCommand('Saveas',true,'%
}