如何在button事件里调用FileUpload呢? 为了把FileUpload的按钮文字改掉,画面上放了一个隐藏的FileUpload,想点击一下按钮,调用这个FileUpload,在click事件里该如何写呢?急 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 本帖最后由 net_lover 于 2011-07-05 13:00:48 编辑 先把fileupload visible=false ,onclick 事件中,设置visible=true 为了把FileUpload的按钮文字改掉隐藏fileupload OR CSS<html><head><title>test</title><style>a.files {width:90px;height:30px;overflow:hidden;display:block;border:1px solid #BEBEBE;background:url(img/fu_btn.gif) left top no-repeat;text-decoration:none;}a.files:hover {background-color:#FFFFEE;background-position:0 -30px;}a.files input {margin-left:-350px;font-size:30px;cursor:pointer;filter:alpha(opacity=0);opacity:0;}a.files, a.files input {outline:none;/*ff*/hide-focus:expression(this.hideFocus=true);/*ie*/}</style><script type="text/javascript">window.onload= addfile;function addfile(){var file = document.createElement("input");file.name = "filename";file.type = "file"; document.getElementById("idFile").appendChild(file);}function hrefclick(){return false;}</script></head><body><a href="javascript:void(0);" class="files" id="idFile"></a>sa</body></html> lz 的意思是想把“浏览”改成其他的文字是吧 那你可以不用fileupload这个控件嘛 用一个button代替fileupload button的onclick事件里写OpenFileDialog ofd = new OpenFileDialog(); ofd.ShowDialog(); MessageBox.Show(ofd.FileName);这样不就行了 button上的文字你想写啥就写啥 或者在html里写这: <input type="file" id="file3" style="display:none"><input type="button" value="上传(随便你想要写的)" onclick="file3.click()"> 我也不会,只不过我们得项目是用的sliver light ,上传什么的 sliver light 类似 Flash 的东西 正则表达式截取字符串 js事件删除问题 rivate void DataList1_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)这个事件什么时候走 跪求水晶报表11下载~!在线等。可以下立即给分哈~! VS2008的解决方案 DataList控件动态增加或隐藏一列 在调试水晶报表时,出错。急急 如何动态的添加控件并且得到事件处理??---有好思路可以加分 问:.net安装程序安装在本地,现在无法卸载!!!怎么办? 我在对datagrid中的一行进行编辑时,在更新该记录前怎样对该行的值进行验证。 在网页扫描并显示图片 Page.Cache和Response.Cache有什么区别?
隐藏fileupload OR CSS
<html>
<head>
<title>test</title>
<style>
a.files {
width:90px;
height:30px;
overflow:hidden;
display:block;
border:1px solid #BEBEBE;
background:url(img/fu_btn.gif) left top no-repeat;
text-decoration:none;
}
a.files:hover {
background-color:#FFFFEE;
background-position:0 -30px;
}
a.files input {
margin-left:-350px;
font-size:30px;
cursor:pointer;
filter:alpha(opacity=0);
opacity:0;
}
a.files, a.files input {
outline:none;/*ff*/
hide-focus:expression(this.hideFocus=true);/*ie*/
}
</style>
<script type="text/javascript">
window.onload= addfile;
function addfile(){
var file = document.createElement("input");
file.name = "filename";
file.type = "file"; document.getElementById("idFile").appendChild(file);
}function hrefclick()
{
return false;
}</script>
</head>
<body>
<a href="javascript:void(0);" class="files" id="idFile"></a>sa
</body>
</html>
OpenFileDialog ofd = new OpenFileDialog();
ofd.ShowDialog();
MessageBox.Show(ofd.FileName);这样不就行了 button上的文字你想写啥就写啥 或者在html里写这:
<input type="file" id="file3" style="display:none">
<input type="button" value="上传(随便你想要写的)" onclick="file3.click()">
我也不会,只不过我们得项目是用的
sliver light ,上传什么的