zoukankan      html  css  js  c++  java
  • HttpContext.Current.Request.Files

    HttpFileCollection files = HttpContext.Current.Request.Files;

    如果 files返回的结果总是不对

    解决:必须为file控件添加Name属性

    <script type="text/javascript">
    function addFile() {
    var str = '<div class="R_C_Column"><div class="R_C_Left">请选择图片:</div><div class="R_C_Right"><input type=file name=File runat=server style= 300px /></div></div>';
    document.getElementById('FileList').insertAdjacentHTML("beforeEnd", str);
    //$("#FileList").html(str);
    }
    </script>
    document.getElementById('FileList').insertAdjacentHTML("beforeEnd", str):

    添加HTML内容与文本内容以前用的是innerHTML与innerText方法,最近发现还有insertAdjacentHTML和insertAdjacentText方法,这两个方法更灵活,可以在指定的地方插入html内容和文本内容。
    1. beforeBegin: 插入到标签开始前

    2. afterBegin:插入到标签开始标记之后

    3. beforeEnd:插入到标签结束标记前

    4. afterEnd:插入到标签结束标记后

  • 相关阅读:
    shift
    start
    exit
    call
    goto
    Activity生命周期(二)
    color 和 mode
    pause 和 title
    day 4 飞机大战-面向对象
    day 3 创建窗口,移动-函数版
  • 原文地址:https://www.cnblogs.com/zhubenxi/p/5142555.html
Copyright © 2011-2022 走看看