An outlet for my obsession with technology
Dojo and ASP.NET AJAX Compatibility
As part of developing a project I created a Cross-Domain Proxy to consume the payment service. My Cross-Domain Proxy, Payment.asmx, is exposed via the JavaScript end point. Any ASP.NET web service can open the JavaScript endpoint by uncommenting line #7 in the asmx file.
Once the ScriptService line is uncommented you can test that your service is exposing the JavaScript endpoint by calling a URL similar to:
1: ~/WebService.asmx/JS
In the master page I pull the service in.
1: <asp:ScriptManager ID="ocScriptManager" runat="server">
2: <Services>
3: <asp:ServiceReference Path="~/WebServices/Payment.asmx" />
4: </Services>
5: </asp:ScriptManager>
At this point everything works. I can write JavaScript to call back to the web service methods as such:
1: WebService.AddItem('item', CallBackFunction, FailFunction);
2:
3: CallBackFunction = function(){
4: alert('everything worked');
5: }
Now, I pull dojo into this project.
1: <script type="text/javascript">djConfig = { parseOnLoad: false, usePlainJson: true };</script>
2: <script type="text/javascript" src="http://dojopath/dojo.js"></script>
Here is where we start to run into problems. Due to, what I believe, is having both JavaScript APIs in the same project.
If we change the order of API loading we can get a, somewhat, clearer error message.
Now looking at line 1175 we see:
Conclusion:
I believe that I have exhausted my troubleshooting efforts. although I am not sure if this is enough information to validate the existence of a bug I opened a ticket with Dojo. Then again, I am not sure who can or should fix it.
http://trac.dojotoolkit.org/ticket/7353
I blogged about this once before.
http://eric.polerecky.com/archives/dijitformvalidationtextbox-and-aspnet-ajax/
Workaround:
In my project I use dojo.xhr to make calls back to the server.
No related posts.
| Print article | This entry was posted by Eric Polerecky on February 13, 2009 at 5:43 pm, and is filed under ASP.NET, ArcGIS, Dojo, JavaScript, development. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |