zoukankan      html  css  js  c++  java
  • 不刷新动态添加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="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="80%" NAME="File">'; " +
            
    " document.getElementById('MyFile').insertAdjacentHTML("beforeEnd",str); " +
            
    " btn.value='继续添加附件'" +
           
    "}"true);
            btn_AddFile.Attributes.Add(
    "onClick""addFile(this)");
    }
  • 相关阅读:
    Windows异常处理机制介绍
    OD 与 Win7
    对VC6编译优化的简单测试
    QQ版本号(2012/07/22 更新)
    OD与调试符号
    Balsamiq Mockups
    hotpatch热修补
    QQ
    VC的编译开关参数大全
    隐藏秘技:vc输出类的layout信息
  • 原文地址:https://www.cnblogs.com/juan/p/1430701.html
Copyright © 2011-2022 走看看