你这个逻辑有点混乱, 服务器的代码在输出HTML时已经执行了. 你的保存按钮是个button还是submit?
解决方案 »
- JQuery CheckBox勾选状态在clone()时保持问题 IE8失效
- 用JS挂一个悬浮在窗口上的层
- 如何用JS限制拖拉的范围+再求拖拉后的显示所有的DIV的坐标
- 求梅花雪大侠的MzTreeView2.0版本的树控件
- 我单独执行一个js文件的时候可以,为什么调用就不可以呢?进来帮我看看解决一下好吗?急啊
- 如何判断输入的是否为规范的文件路径?包括有目录和没有目录的,有扩展名和没扩展名的等,不能有不允许的字符串。
- 高分求一横向菜单,先谢了!!!!
- 一个下拉列表传值查询的问题
- jquery datatable翻页功能无法实现
- 使用location.href不跳转页面
- 关于区分单击和双击的问题
- execCommand 获取
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
var xmlhttp;
function Validation()
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
var name=document.getElementById("Text1");
xmlhttp.open("Post","AJAXProcessor.aspx?name="+name.value);
xmlhttp.onreadystatechange=OnMessageBack;
xmlhttp.send(null);
}
function OnMessageBack()
{
if(xmlhttp.readystate==4&&xmlhttp.status==200)
{
document.write(xmlhttp.responsetext);
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Text1" type="text" /><input id="Button1" type="button" value="button" onclick="Validation();" />
</div>
</form>
</body>
</html>
string ReAction = this.Request.QueryString["Action"];//这是你从页面上请求来的值
SqlConnection Conn = new SqlConnection(“连接字符串");
Conn.Open();
SqlCommand Cmd = new SqlCommand();
Cmd.Connection = Conn;
Cmd.CommandText = "更新字符串";
Cmd.ExecuteNonQuery();
Conn.Close();
还有个问题,用户输入的东西保存到哪里去了?谢谢
完善5楼的。var xmlHttp=false;
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e2)
{
xmlHttp=false;
}
}
if(!xmlHttp && XMLHttpRequest!='undefined')
{
xmlHttp=new XMLHttpRequest();
}另外采取post提交数据时,在处理页面用Request.Form[]接受数据...