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

前台代码

 <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传输,一般处理程序获取,希望大佬能直接点

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问