52,797
社区成员
发帖
与我相关
我的任务
分享
//前台代码
//#contact-form 表单ID
$(function () {
$("#contact-form").submit(function () {
$.ajax({
type: "post",
url: "?",
dataType: "text",
async: false,
data: $('#contact-form').serialize(),
success: function (data) {
debugger;
alert(data);
}
});
});
});
//后台代码
string name = Request.Form["name"];
string textEmail = Request.Form["email"];
string pone = Request.Form["pone"];
string messages = Request.Form["message"];
string Msg = "";
BusinessConsulted bcb = new BusinessConsulted
{
MessageName = name,
MessageEmail = textEmail,
ContactInformation = pone,
Messages = messages,
MessageTime = DateTime.Now.ToString(),
State = 0,
ClassifyOne = 0,
ClassifyTwo = 0
};
BusinessConsultedBLL bb = new BusinessConsultedBLL();
bb.InsertBusinessConsulted(bcb, ref Msg);
Response.Write(Msg);
Response.End();