会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
智者生存
学习他人长处!做个有个人魅力的人!
博客园
首页
新随笔
联系
订阅
管理
不刷新动态添加FileUpload
页面
<
tr
>
<
td
align
="right"
style
="height: 48px"
>
<
asp:Label
ID
="Label8"
runat
="server"
Text
="附 件:"
Width
="100%"
></
asp:Label
></
td
>
<
td
align
="left"
colspan
="3"
style
="height: 48px"
>
<
div
id
="MyFile"
style
="width:100%"
>
<
asp:FileUpload
ID
="FileUpload1"
runat
="server"
Width
="80%"
/>
</
div
>
<
input
id
="btn_AddFile"
type
="button"
runat
="server"
value
="添加附件"
/>
</
td
>
</
tr
>
.cs中
protected
void
Page_Load(
object
sender, EventArgs e)
...
{
//
注册添加文件脚本
this
.Page.ClientScript.RegisterStartupScript(
this
.GetType(),
"
MyScript
"
,
"
function addFile(btn)
"
+
"
{ var str = '<br><INPUT type="file" style="width:80%" NAME="File">';
"
+
"
document.getElementById('MyFile').insertAdjacentHTML("beforeEnd",str);
"
+
"
btn.value='继续添加附件'
"
+
"
}
"
,
true
);
btn_AddFile.Attributes.Add(
"
onClick
"
,
"
addFile(this)
"
);
}
posted @
2009-04-07 09:56
智者生存
阅读(
442
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
公告