Showing posts with label functions. Show all posts
Showing posts with label functions. Show all posts

Saturday, March 24, 2012

Deployment on production server : Ajax does not function; on local WorkStation is Ok

Hello,

I have just put to me to the AJAX, I installed it well on my PC, my ajax project with "Update Panel" functions locally.

I put it in production, I put the extensions in [bin]: "AjaxControlToolkit.dll"; System.Web.Extension is quite present in the GAC and when I click on the button to refresh the "update panel" in which a label update yourself. a traditional PostBack of alll the page is carried out! as if there were no Ajax!!?

Help me!


En fran?ais :

Bonjour,

Je viens de me mettre à l'AJAX, je l'ai bien installé sur mon poste, mon projet ajax avec un Update Panel fonctionne en local.

Je le mets en production, j'ai mis les extensions dans [bin] :
"AjaxControlToolkit.dll", System.Web.Extension est bien présent dans le GAC

et quand je clique sur le bouton pour rafraichir l'update panel dans lequel un label se mets à jour. un rafraichissement classique de toute la page s'effectue! comme si il n'y avait pas d'Ajax!!?

un peu d'aide ne serait pas de refus!

The first think I will ask you is to make sure the same version of Ajax is installed on the production server. I know it may sound silly, but I know several people with similar problem and they claim that they have the same version, but when they take a deeper look, they notice that there was not the same.

Wednesday, March 21, 2012

Declarative Markup within a server control

I'm creating an address control that is utilizing Atlas in a couple of places. The first place I use it I've got the javascript functions working fine. (It auto fills the address based on the zip code.)
After the autofill, the user is allowed to type in changes as needed. I was going to use the autocomplete in the state portion, and was going to use the declarative markup similar to the HOLs. When putting two of the controls on a page I was registering two declarative blocks, and they don't work. I tested it in straight HTML outside the control and got the same result. However, in the HTML test I combined it to one block (below) and it works fine.
My problem is how to get the control to render one block of declarative markup if more than one of the same control exists.
Script

<scripttype="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<references>
<!-- Repath the following src attributes, using regular client relative paths as necessary -->
<add src="ScriptLibrary/AtlasUI.js" />
<add src="ScriptLibrary/AtlasControls.js" />
</references>
<components>
<textBox id="Address2_txtState">
<behaviors>
<autoComplete
completionList="completionList"
serviceURL="Services/AddressAutoComplete.asmx"
serviceMethod="GetStateList"
minimumPrefixLength="1"
completionSetCount="10"
completionInterval="500" />
</behaviors>
</textBox>
<textBox id="Address2_txtState">
<behaviors>
<autoComplete
completionList="completionList"
serviceURL="Services/AddressAutoComplete.asmx"
serviceMethod="GetStateList"
minimumPrefixLength="1"
completionSetCount="10"
completionInterval="500" />
</behaviors>
</textBox>
</components>
</page>
</script>


I don't think I exactly understand your problem. Could you maybe share the code that resulted in "two declarative blocks"?

My original design created one declarative block per server control. As long as I only have one control, that works fine. As soon as I drop the second one on the page, neither of them work because I get two blocks (below), rather than the one block needed in my original post.

<scripttype="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<references>
<!-- Repath the following src attributes, using regular client relative paths as necessary -->
<add src="ScriptLibrary/AtlasUI.js" />
<add src="ScriptLibrary/AtlasControls.js" />
</references>
<components>
<textBox id="Address1_txtState">
<behaviors>
<autoComplete
completionList="completionList"
serviceURL="Services/AddressAutoComplete.asmx"
serviceMethod="GetStateList"
minimumPrefixLength="1"
completionSetCount="10"
completionInterval="500" />
</behaviors>
</textBox></components>
</page>
</script>

<scripttype="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<references>
<!-- Repath the following src attributes, using regular client relative paths as necessary -->
<add src="ScriptLibrary/AtlasUI.js" />
<add src="ScriptLibrary/AtlasControls.js" />
</references>
<components>
<textBox id="Address2_txtState">
<behaviors>
<autoComplete
completionList="completionList"
serviceURL="Services/AddressAutoComplete.asmx"
serviceMethod="GetStateList"
minimumPrefixLength="1"
completionSetCount="10"
completionInterval="500" />
</behaviors>
</textBox></components>
</page>
</script>


Interesting. All server-side Atlas controls should render their scripttags to 1 AtlasTextWriter, which will write the contents inside asingle script tag. At least that's what it is supposed to do.
Do you have a repro that results in the code you pasted?

As I understand it, you have created a custom composite server control? How are you rendering out the declartive block? Are you just string.building? Maybe you should look into this AtlasScriptWriter the other poster mentioned.

Does anyone have any more info on this AtlasScriptWriter (or AtlasTextWriter)? Is this the recommended method for rendering custom Atlas controls?