Showing posts with label root. Show all posts
Showing posts with label root. Show all posts

Saturday, March 24, 2012

my web service call works from one page, not from the other.

have a user control that uses Atlas to call a web service. I drop
this control on a page in the root directory and it works with no
problem. I then add the control to another control, which is on
another page and it will not work. It does not seem to know what the
webService is.

My web service is in the same project and the ascx control and is named
meterCommunication.asmx in a folder called webService.

The control is a button ond onClick it callas a javascript function
that has the following line for calling the web service:
meterCommunication.sendMessage(meterID, commType, _onRequestComplete);

The error that I get is a javascript error that says:
meterCommunication is undefined

I can't figure out what is different between the two pages. Since this
is on a user control they should be identical.

How does the javascript know what meterCommunication is?
I don't know enough about this to troubleshoot the problem.

You need to make sure that you import the web service proxy, either in your page or in the user control. This is done using:
<scriptsrc="/yourapp/subdir/YourService.asmx/js"type="text/javascript"></script>
Maybe you have that only on the page that works?

Namespace Question

The AtlasControlToolkit has a root namespace of AtlasControlToolkit, and the class files also have a namespace AtlasControlToolkit specified. To register the control, the namespace AtlasControlToolkit is used.

I am writing a new extender and am wrapping into a toolkit framework so that the next time I decide to add a control, my "toolkit" is already setup. I have specified a root namespace of My and my class files contain a namespace dictating My as well. In order to register my toolkit, I am forced to use "My.My". Where does the AtlasControlToolkit lose this extra level? Having My.MyAutoComplete is much nicer than My.My.MyAutoCompleteConfused

I'm not sure I fully understand your question. What do you mean by "register my toolkit" exactly?

Are you using VB? VB specifies a default root namespace, whereas C# does not. So if you apply a namespace, yes, you'll get the doubling up. So in your case, change the Default Namespace in the project properties to "My" and then don't add a namespace to your class files.


Yes, I am using VB. For not understanding my question, you did a darn good job of answering it! Smile Now if only you could solve my other problems haha.
Better lucky than good...:)