The page to update
Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title></title>
<script src= "Js/jquery.js" type= "Text/javascript" ></script>
<body>
<select id= "Lucky1" onchange= "return Duoduo ();" >
<option value= "1" > Phase I </option>
<option value= "2" > Phase II </option>
</select>
<div id= "Duoduo" >
Hello </div>
<input type= "text" id= "Duo"/>
</body>
<script type= "Text/javascript" >
function Duoduo () {
$.ajax ({
Type: ' Post ',//optional get
URL: ' ajax.aspx ',//Here is the program to receive data
Data: ' Data= ' + $ ("#lucky1"). Val (),//Pass to PHP, multiple parameters & connection
DataType: ' HTML ',//server returned data type optional XML, Json jsonp script HTML text, etc.
Success:function (msg) {
Here is the data processing function returned by the program after the success of the Ajax commit. MSG is the returned data, and the data type is defined in the datatype parameter!
Document.getelementbyidx_x_x ("Duoduo"). InnerHTML = msg;
$ ("#duoduo"). InnerHTML = msg;
},
Error:function () {
Alert (' Sorry for failure ');
}
})
}
</script>
Action Page
Copy Code code as follows:
protected void Page_Load (object sender, EventArgs e)
{
if (request.params["data"). ToString (). Equals ("1"))
{
Response.Write ("<a href=\" http://www.baidu.com\ "> Phase I </a>");
}
else if (request.params["data"). ToString (). Equals ("2"))
{
Response.Write ("<a href=\" http://www.baidu.com\ "> Phase 2nd </a>");
}
}