Callbacks 2.0 and ActiveX

G

Guest

Callbacks in 2.0 appear to work even with ActiveX disabled in IE. There are
2 curious things I've noticed that if anyone has any knowledge on I'd
appreciate.

1. If ActiveX is disabled you do see the progress bar work but the page is
not refreshed (did some kind of postback occur that doesn't refresh page).
Does anyone know what is going on here?

2. In the WebForm_DoCallback method (found inside .axd page) xmlRequest is
first declared as new XMLHttpRequest(). I can't find any reference to
XMLHttpRequest(), does anybody know where it is declared?

The good news is that appears I can use Callbacks without worrying if the
client browser has ActiveX but I'd like to know more about how this is
working.

thanks
 
G

Guest

After more research I ended up being able to answer my own post.

It appears WebForm_DoCallback attempts:
1. Create XMLHttpRequest object -- which will work for Safari and Mozilla
2. Create ActiveX Microsoft.XMLHTTP object
3. Uses an IFRAME

So the progress bar I was seeing was for an IFRAME submit.

Good news is it looks like you can use Callback regardless if the user has
ActiveX enabled or not. Nice job Microsoft!!!
 
B

Bruce Barker

XMLHttpRequest is a browser internal object used by
Mozzila/Opera/Safari/Fireflox. it was based the ms xml com object
IXMLHTTPRequest which can be used in IE. the mozzila docs refer you to the
ms docs. one additional feature over the MS version is direct supports of
SOAP calls.

asp.net 2.0 callback code, checks for XMLHttpRequest first, then tries to
create the active/x version. if both of these fail, then it uses a hidden
iframe. the downside of using an iframe is you lose xml parsing, and sync
support.

-- bruce (sqlwork.com)
 
S

sp3d2orbit

1. If ActiveX is disabled you do see the progress bar work but the page is
not refreshed (did some kind of postback occur that doesn't refresh page).
Does anyone know what is going on here?

You're right. The only way to disable it seems to be to disable
scripting altogether. Though, for callbacks your page shouldn't
postback at all.
2. In the WebForm_DoCallback method (found inside .axd page) xmlRequest is
first declared as new XMLHttpRequest(). I can't find any reference to
XMLHttpRequest(), does anybody know where it is declared?

XMLHttpRequest() is used by Mozilla and Safari. They don't support
ActiveX, so the developers included this object. IE will use the second
part of the catch block

xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");

Here's a page on the XMLHttpRequest object:

http://developer.apple.com/internet/webcontent/xmlhttpreq.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top