Showing posts with label locally. Show all posts
Showing posts with label locally. Show all posts

Saturday, March 24, 2012

CascadingDropDown works locally but not in production :(

I have a webcontrol that has a cascading drop down on it. It works great locally and it even works on one site on the production box but on another site it's not working at all.

When i view the soure locally, the bottom of the page has this:


<script type="text/javascript">
<!--
Sys.Application.queueScriptReference('/ScriptResource.axd?d=l8kme79LK37kNlRrAwkn4PmL8-xStSVBSrJo-1R7TM1iwaoCqJ1vwb4J4WezGvqzcUVV2DXtyW0_vdYX2osULzIIpv4c1X8ugso_D_opuH_NgNvFbZCQpZuDNYA5QZiu0&t=632999597834800200');
Sys.Application.queueScriptReference('/ScriptResource.axd?d=l8kme79LK37kNlRrAwkn4PmL8-xStSVBSrJo-1R7TM1iwaoCqJ1vwb4J4WezGvqzcUVV2DXtyW0_vdYX2osULzJI-iPrGdhwBb_ttd4JLeZNXWsInBtmjFBOo2HjJO4T0&t=632999597834800200');
Sys.Application.queueScriptReference('/ScriptResource.axd?d=l8kme79LK37kNlRrAwkn4PmL8-xStSVBSrJo-1R7TM1iwaoCqJ1vwb4J4WezGvqzcUVV2DXtyW0_vdYX2osULxwEztykssfzEPaqC7e0w3GSj3I_ajLJJSZPUOiWBO-4WX5KGuOIsKnZ6bBD0-vgFw2&t=632999597834800200');
Sys.Application.queueScriptReference('/ScriptResource.axd?d=l8kme79LK37kNlRrAwkn4PmL8-xStSVBSrJo-1R7TM1iwaoCqJ1vwb4J4WezGvqzcUVV2DXtyW0_vdYX2osUL8XSATuKv5sfFg9o9Zcf0duyde9-TL64IHjvO6rQEiff0xK_M6hS6brl95FcYskfAIaBT0vTReXwWC6ZPyjzBVA1&t=632999597834800200');
Sys.Application.add_init(function() {
$create(AjaxControlToolkit.CascadingDropDownBehavior, [SNIP]);
});
Sys.Application.add_init(function() {
$create(AjaxControlToolkit.CascadingDropDownBehavior, [SNIP]);
});
Sys.Application.initialize();
// -->
</script>
 
but when i view the source from production, that's completely missing. Anyone run into something like this before? 
 
BTW: this is on beta 2 and v.1.0.61106.0 of the toolkit. 

I was able to solve this myself by digging deeper.

there was a multiview on the page and the scriptmanager was in one of the views but not the others so no errors were thrown but the scriptmanager wasn't rendering the javascript.

CascadingDropDown Work only locally

HI,

I basically followed the sample toolkitCascadingdropdown. i only need 2 dropdown lists - Country and State.

everything works find on both local and live server. but when I'm calling the webservice from another website it has problems - a javascript error

<asp:DropDownList ID="ddlCountry" runat="server" />
<asp:DropDownList ID="ddlState" runat="server" />

<ajaxtoolkit:cascadingdropdown id="CascadingDropDown1" runat="server" category="State" loadingtext="Please wait..." parentcontrolid="ddlCountry" prompttext="Select a country"
servicemethod="GetStatByCountryID" servicepath="http://www.domainname.com/WebService/AddressService.asmx" targetcontrolid="ddlState">
</ajaxtoolkit:cascadingdropdown>

all sample I've seen is for working locally - both dropdownlists and webservice are sitting in the same website.

wondering if anyone can show me show to implement this cascadingdropdown by calling an external webservice

much appreciated

Hi,

So your intention is to call a external web service?

XmlHttpRequest object can't access external web service directly for security reasons. So, you may achieve this by adding a web service in the same domain, and this web service calls the external service. On client side, use this new web service to access the external web service indirectly.

Hope this helps.


This is exactly what I did, works out perfectly.

I created a local webserivce calling the external one.

much appreciated for your reply.