Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > (Ajax) Loading a web service after async postback

Reply
Thread Tools

(Ajax) Loading a web service after async postback

 
 
elado7@gmail.com
Guest
Posts: n/a
 
      10-15-2007
Hey

I'm trying to load a webservice after an async postback in the
following way:

ScriptManager.GetCurrent(Page).Services.Add(new
ServiceReference("WS.asmx"));

in order to have a client-side access to its web methods.

When doing it with normal postback or in the first load of the page,
it works, but if I load it manually from within a code after an async
postback, the code doesn't appear to download to the browser.
I load if from the code since it comes from a dynamically loaded user
control (ascx loaded thru Page.LoadControl).

So, I tried to load it like a javascript include in the following way:

ScriptManager.RegisterClientScriptInclude(Page,Pag e.GetType(),"key","file.asmx/
js");

However, since the source is missing the
'Sys.Application.notifyScriptLoaded()' call, the ajax framework yelled
at me :
Microsoft JScript runtime error: Sys.ScriptLoadFailedException:
The script '...' failed to load. Check for:
Inaccessible path. Script errors. (IE) Enable 'Display a
notification about every script error' under advanced settings.
Missing call to Sys.Application.notifyScriptLoaded().

So, finally I tried to load the script's content and register it as a
script block. Bah. The asmx is protected thru authorization.

My solution could be allowing anonymous access to the asmx, or make a
js function that'll document.createElement a script and inject it to
the <head>, and register it as a script block.
But I'm asking -- isn't there any other clean way? Can't I just
disable the notifyScriptLoaded?

Thanks
Elad

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any way to convert an async postback to a full postback incode-behind? Ed Cayce ASP .Net 0 08-07-2009 11:23 PM
Newbie: async mode dedicated versus async mode interactive!! Pink_Floyd Cisco 4 06-16-2006 12:16 AM
Async webservice call in async webpage (.Net 2.0) does not return Steven ASP .Net Web Services 0 11-30-2005 01:06 AM
Async Web Service - Maximum Time? Lucas Tam ASP .Net 2 04-14-2005 02:35 AM
Async web service problem Emre Aydinceren ASP .Net Web Services 0 07-22-2003 03:25 PM



Advertisments