How i can create a datatable in javascript to pass to a webmethod now if the namespace Sys.Data is removed?
Thanks
Just add the Preview version.
How i can create a datatable in javascript to pass to a webmethod now if the namespace Sys.Data is removed?
Thanks
Just add the Preview version.
Why do I only get access to Sys.WebForms.PageRequestManager if I have an updatepanel in my page? I have some really good uses for this method, but right now I only get access to the object if I include an UpdatePanel in the page.
If I want to include this when I have my control in the page, what is the parameters needed to extract it from the resources using Page.ClientScript.GetWebResourceUrl ?
In the RTM version (due out by the end of this month), Sys.WebForms.PageRequestManager will be available even if you don't have an UpdatePanel on the page. In the mean time, I recommend just putting an empty one on the page: <asp:UpdatePanel runat="server" />.
Wow - glad I found this post, that was going to be a long, painful and probably fruitless debug session otherwise. Thanks for that!
PS. Anyone know *why* this is the case?
Hi guys,
I have noticed the following code in the abort function of the Sys.Net.XMLHttpExecutor class:
var a=this._webRequest._get_eventHandlerList().getHandler("completed");
if(a)
a(this,Sys.EventArgs.Empty)
The documentation states that the completed event of the WebRequestManager is raised when the request is completed, timed out or aborted.
Maybe the code should be:
a._webRequest.completed(Sys.EventArgs.Empty);
like in the case when the request is completed or timed out.
Is thig a bug or a feature?
Bogdan
The executor sets the Web request state to aborted. This means that the XMLHttpExecutor Class instance's started Property and aborted Property methods both return true.The unique document?about?Sys.Net.XMLHttpExecutor we can use is from?here?-?http://ajax.asp.net/docs/ClientReference/Sys.Net/XmlHttpExecutorClass/default.aspx
Try to take a look at it and get some ideas from it.
Thank you for your response! Perhaps I didn't make it clear enough .. I agree on what you said about the abort method and what happens if it is called multiple times but my concerns are related to the completedRequest event of the WebRequestManager that is no longer raised in this case.
When a request is timed out the _onTimeout event handler is called and thus the WebRequest's completed event is called:
this._onTimeout=function(){
if(!a._responseAvailable){
a._clearTimer();
a._timedOut=true;
a._xmlHttpRequest.onreadystatechange=Function.emptyMethod;
a._xmlHttpRequest.abort();
a._webRequest.completed(Sys.EventArgs.Empty);
a._xmlHttpRequest=null
}
}
By Calling the completed method of the underlying WebRequest the completedRequest event of the WebRequestManager and also the completed event of the WebRequest are raised and all the registered event handlers notified.
Likewise in the XMLHttpExecutor class when the request completes the same completed method of the WebRequest is invoked:
this._onReadyStateChange=function(){
if(a._xmlHttpRequest.readyState===4){
a._clearTimer();
a._responseAvailable=true;
a._webRequest.completed(Sys.EventArgs.Empty);
if(a._xmlHttpRequest!=null){
a._xmlHttpRequest.onreadystatechange=Function.emptyMethod;
a._xmlHttpRequest=null
}
}
};
Like in the first case the completedRequest event is also raised.
When the request is aborted the completedRequest is not raised any more :
abort:function(){
if(this._aborted||this._responseAvailable||this._timedOut)
return;
this._aborted=true;
this._clearTimer();
if(this._xmlHttpRequest&&!this._responseAvailable){
this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;
this._xmlHttpRequest.abort();
this._xmlHttpRequest=null;
var a=this._webRequest._get_eventHandlerList().getHandler("completed");
if(a)
a(this,Sys.EventArgs.Empty)
}
}
};
What do you think about the above mentioned? Do they represent the correct behavior?
Thanks in advance,
Bogdan
Phew !!
Check out this post:
http://forums.asp.net/thread/1537056.aspx
They have finally realized the bug.. Probably it'll be fixed in the RTM release..
Bogdan
xml script spec