冷淡的胖子 2017-10-16 10:25 采纳率: 43.8%
浏览 1761
已结题

c#中用ajax和一般处理程序传文件

前台代码

 <div class="fk_cont2">
                <div class="from1 col-xs-12 col-sm-12 col-md-6 col-lg-6">
                    <h1>Required Information</h1>
                    <h2><span>Subject</span><input type="text" name="" placeholder="5- 255 characters." id="Subject" maxlength="255"/></h2>
                    <h2><span>Email</span><input type="text" name="" placeholder="Please make sure your email works properly!" id="Email"/></h2>
                    <h3>
                        <span>Message</span>
                        <textarea name="" rows="" cols="" maxlength="3000" id="Message" placeholder="20-3000 characters.
Use only English words and punctuation. 
(Please allow pop-upwindows here to check non-English words and punctuation.) 
Please describe your message details 
(such as: product specification, company description, etc.) 
as clearly as possible to get prompt and precise replies."></textarea>
                    </h3>
                </div>
                <div class="from2 col-xs-12 col-sm-12 col-md-6 col-lg-6">
                    <h1>Additional Information</h1>
                    <div class="from2_s">
                        <h2>
                            <span>Country</span>
                            <input type="text" name="" placeholder="" id="Country"/>
                        </h2>
                        <h2>
                            <span>Full Name</span>
                            <input type="text" name="" placeholder="" id="name" />
                        </h2>
                    </div>
                    <h3>
                        <span>Company</span>
                        <input type="text" name="" placeholder="" id="Company" />
                    </h3>
                    <h4>
                        <span>Phone Number</span>
                        <input type="text" name="" placeholder="-Country code-" id="Countrycode" />
                        <input type="text" name="" placeholder="-Area code-"id="Areacode" />
                        <input type="text" name="" placeholder="-Tel Number-"id="tel" />
                    </h4>
                    <h3>
                        <span>Website</span>
                        <input type="text" name="" placeholder="" id="Website" />
                    </h3>
                    <div class="text">
                        <h5>
                            <span>Add Attachment</span>
                            <b>Select file<input type="file" name="" value="" id="file1"/></b>
                            <i></i>
                            <em class="clear"></em>
                        </h5>
                        <h6>( File size is less than 2M )</h6>
                    </div>
                </div>
                <div class="btnss col-xs-12 col-sm-12 col-md-6 col-lg-6">
                    <a href="javascript:void(0)" onclick="TJSubmit()">Submit</a>
                    <%--<a href="">Submit</a>--%>
                </div>
                <div class="clear"></div>
            </div>

点击事件,不仅仅要传文件还有其他的信息一起传递到后台一般处理程序

 function TJSubmit() {
    }

之前有试过网上的formdata在后台一直都获取不到值,可能是我获取的方式不对,所以我想有一套完整的 前台获取,ajax传输,一般处理程序获取,希望大佬能直接点

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器