日期:2014-05-17 浏览次数:20535 次
var postPage;
var displayElement;
function pageLoad()
{
postPage = "postTarget.aspx";
displayElement = $get("ResultId");
}
// This function performs a POST Web request
// to upload information to the resource
// identified by the Url.
function PostWebRequest()
{
// Instantiate the WebRequest object.
var wRequest = new Sys.Net.WebRequest();
// Set the request Url.
wRequest.set_url(postPage);
// Set the request verb.
wRequest.set_httpVerb("POST");
var body = "Message=Hello! Do you hear me?"
wRequest.set_body(body);
wRequest.get_headers()["Content-Length"] = body.length;
// Set the web request completed event handler,
// for processing return data.
wRequest.add_completed(OnWebRequestCompleted);
// Clear the results page element.
displayElement.innerHTML = "";
// Execute the request.
wRequest.invoke();
}
------解决方案--------------------
因此相对于企业web开发来说,asp.net ajax跟现在所说的jaavscript ajax,是两个概念。
asp.net ajax它首先是一大堆控件,让我们高效率地拿来就用来开发复杂的界面(可惜asp.net项目组实在是败家)。而有些人把一两个ajax就叫做ajax了,你让他写上一个稍微功能丰富一点的交互式、可高效书写绑定表达式的GridView控件试试(完全基于ajax来写),那些写不出来的人完全不是很好的开发者,只是空谈ajax而已。
------解决方案--------------------
ajax现在JQUERY 是主流也是最值得学的一门 拖控件这些东西学了也白学。
------解决方案--------------------
否定控件流的,我看都转vbscript或者java,php吧。
------解决方案--------------------
我一般都用jquery的ajax和updatepannel
------解决方案--------------------
无论哪种 最后都是脚本代码XmlHttprequest
只是需不需要你自己写而已