一:Url参数提交数据

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><script?type?="text/javascript"?src?="../js/jquery.js"></script>
<script?type="text/javascript">
????????function?checkCorpID()//检测客户编号是否可用
????????{
????????????if($.trim($("#txtF_CORPID")[0].value)=="")//txtF_CORPID是客户编号输入框
????????????{
????????????????alert("请输入客户编号!");
????????????}
????????????else
????????????{
????????????????$("#checkFlag").html("正在检测

????????????????$.ajax({
?????????????????type:?"get",
?????????????????url:?"CheckCorpID.ashx",
?????????????????data:?"ID="+$.trim($("#txtF_CORPID")[0].value),//提交表单,相当于CheckCorpID.ashx?ID=XXX
?????????????????success:?function(msg){$("#checkFlag").html("");alert(??msg?);?}???//操作成功后的操作!msg是后台传过来的值
????????????????});?
????????????}?
????????}
</script>
后台代码:

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->if(context.Request.Params["ID"].ToString()!="")
????????{
????????????Pxt.Logic.SYS.CORP_BASE_INFO?cbiL?=?new?Pxt.Logic.SYS.CORP_BASE_INFO();
????????????bool?flag=cbiL.checkCorpID(context.Request.Params["ID"].ToString());
????????????if?(flag)
????????????{
????????????????context.Response.Write("该客户编号已被占用!");
????????????}
????????????else
????????????{
????????????????context.Response.Write("该客户编号可用!");
????????????}
????????}
?
?
二:Form提交数据
前台代码:

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><script?type?="text/javascript"?src?="../js/jquery.js"></script>?//必须要引用
????<script?type?="text/javascript"?src?="../js/jquery.form.js"></script>?//必须要引用
????<script?type="text/javascript">
?????????//?wait?for?the?DOM?to?be?loaded
??????????$(document).ready(function()?
????????????{
????????????????$('#Tip').hide();//显示操作提示的元素不可见
????????????????$('#form1').submit(function()//提交表单
????????????????{
????????????????????//alert("ddd");
????????????????????var?options?=?{?
????????????????????target:'#Tip',?//后台将把传递过来的值赋给该元素
????????????????????url:'ReturnVisit.aspx?flag=do',?//提交给哪个执行
????????????????????type:'POST',?
????????????????????success:?function(){?alert($('#Tip').text());}?//显示操作提示
????????????????????};?
????????????????????$('#form1').ajaxSubmit(options);?
????????????????????return?false;?//为了不刷新页面,返回false,反正都已经在后台执行完了,没事!
????????????????});??
????????????}
?????????);
?????</script>
<body>
????<form?id="form1"?runat="server">
????<div>
????????<table?width="100%"?border="0"?align="center"?cellpadding="0"?cellspacing="0">
??????????<tr>
????????????<td?colspan="2"?class="tableCategory">客户回访</td>
??????????</tr>
??????????<tr>
????????????<td?width="30%"?class="tableBg1">客户名称:</td>
????????????<td?class="tableBg2">
????????????????<asp:TextBox?ID="txtF_CorpName"?runat="server"></asp:TextBox>
????????????????????</td>
??????????</tr>
??????????<tr>
????????????<td?width="30%"?class="tableBg1">回访主题:</td>
????????????<td?class="tableBg2">
????????????????<asp:TextBox?ID="txtF_ReturnVisitTitle"?runat="server"></asp:TextBox>
????????????????????</td>
??????????</tr>
??????????<tr>
????????????<td?width="30%"?class="tableBg1">联系人:</td>
????????????<td?class="tableBg2">
????????????????<asp:TextBox?ID="txtF_ContractPerson"?runat="server"></asp:TextBox>
????????????????????</td>
??????????</tr>
??????????<tr>
????????????<td?width="30%"?class="tableBg1">联系人职务:</td>
????????????<td?class="tableBg2">
????????????????<asp:TextBox?ID="txtF_ContractPersonPosition"?runat="server"></asp:TextBox>
????????????????????</td>
??????????</tr>
??????????<tr>
????????????<td?width="30%"?class="tableBg1">联系电话:</td>
????????????<td?class="tableBg2">
????????????????<asp:TextBox?ID="txtF_ContractPhone"?runat="server"></asp:TextBox>
????????????????????</td>
??????????</tr>
??????????<tr>
????????????<td?width="30%"?class="tableBg1">回访时间:</td>
????????????<td?class="tableBg2">
????????????????<asp:TextBox?ID="txtF_ReturnVisitDate"?runat="server"></asp:TextBox>
????????????????????</td>
??????????</tr>
??????????<tr>
????????????<td?width="30%"?class="tableBg1">回访内容:</td>
????????????<td?class="tableBg2">
????????????????<asp:TextBox?ID="txtF_ReturnVisitContent"?runat="server"></asp:TextBox>
????????????????????</td>
??????????</tr>
??????????<tr>
????????????<td?width="30%"?class="tableBg1">回访相关文档:</td>
????????????<td?class="tableBg2">
????????????????<asp:TextBox?ID="txtF_ReturnVisitFile"?runat="server"></asp:TextBox>
????????????????????</td>
??????????</tr>
??????????<tr>
????????????<td?width="30%"?class="tableBg1"> </td>
????????????<td?class="tableBg2">
????????????????<asp:Button?ID="Submit_BT"?runat="server"?Text="确定"?CssClass="button"?/>
????????????????<input?type="reset"?class="button"?value="还原"?/>
????????????</td>
??????????</tr>
????????</table>
????????<span?id="Tip"></span>
????</div>
????</form>
</body>

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->



















































注:Jquery.form是Jquery用于帮助操作表单的一个插件,具体的去网上看看教程!