This is a migrated thread and some comments may be shown as answers.

AjaxControlToolkit 4 not compatible with Telerik.Web.UI 2011.1.413.40 ?

8 Answers 341 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Al
Top achievements
Rank 1
Al asked on 12 May 2011, 05:08 PM
Hi,

I have a .NET 4 web application on VS2010. I have the latest Telerik Ajax controls 2011.1.413.40. I have an AjaxControlToolkit password strength control on a few of my pages and I had been using version 3.0.20820 with no problem. When I discovered there was a new version I upgraded to AjaxControlToolkit 4.1.50508. But I find it is not compatible with my project. When I click an ajaxified button VS highlights some javascript:

 

 

 if(Array.contains(c,i.get_postBackElement().id))

 


"Error message: Microsoft JScript runtime error: Unable to get value of the property 'id': object is null or undefined"

I've tested the same scenario on a very simple test project to eliminate other possibilities - same result. If I revert back to the old version then it works again. I've read through the forum but I'm completely out of ideas and read this:
http://www.telerik.com/community/forums/aspnet-ajax/scriptmanager-and-stylesheetmanager/known-issues-and-breaking-changes-radscriptmanager.aspx
As far as I can see the two latest version are incompatible. I guess I could live with using the old version but I would like to use the latest version if possible.

Has anyone else had the same problem? Any advice? Am I missing something obvious?

Thanks
Al

8 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 13 May 2011, 01:27 PM
I've also encountered the same problem with AjaxControlToolkit 4. Hopefully we can see this fixed in a new version.
0
Tsvetina
Telerik team
answered on 18 May 2011, 07:24 AM
Hello,

I created a test application using RadControls Q1 2011 SP1 and the latest version of the AjaxControlToolkit and they work together seamlessly without any additional settings/modifications. The limitations that Alun linked to concern a previous version of the RadScriptManager.

Please, modify the project I am attaching until it starts producing the problems that you refer to and post the changes, so that we can inspect what causes them.

Greetings,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Al
Top achievements
Rank 1
answered on 18 May 2011, 11:10 AM
Thanks Tsvetina,

After experimenting further I discovered that the problem appears when I have ajaxified controls on a master page that also has a RadAjaxManagerProxy. On a standard aspx page with RadAjaxManager there is no problem - everything works as it should. I have exactly the same dlls as you have.

Try it yourself...

Al
0
Tsvetina
Telerik team
answered on 20 May 2011, 03:05 PM
Hi Al,

I modified my web site to use a master page with an ajax manager as well and still I could not replicate the problem.

Please, review the project and let me know what am I missing out in my sample.

Regards,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Al
Top achievements
Rank 1
answered on 20 May 2011, 04:25 PM

Ok, I've created a project using your files and replicated my problem. Simply do the following:

Add the following to Default.aspx

(In the RadAjaxManagerProxy)

<telerik:AjaxSetting AjaxControlID="Button1">
   <UpdatedControls>
       <telerik:AjaxUpdatedControl ControlID="Label1" />
   </UpdatedControls>
</telerik:AjaxSetting

 

 

 

 

 


<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label

 

 

 

 

And add this to Default.aspx.cs

 

 

 

protected void Button1_Click(object sender, EventArgs e) 
{
   Label1.Visible = true
}

 

Then click the button....

I don't see a problem with the code. This is basically what I have in my VB version. When you put the button and label in the master page it works (at least it does for my VB project), but when placed in the aspx page itself (as above)... well, you should see the result... exacgtly what I explained in my first post. Furthermore, in my test project I don't even have any ajaxcontroltoolkit controls - I just reference the dll and it fails. When I remove the reference - everything works!

Am I being an idiot and missing something obvious?! :-)

Let me know how you get on.
Thanks
Al


0
Accepted
Tsvetina
Telerik team
answered on 24 May 2011, 02:29 PM
Hi Al,

I managed to replicate the issue and it is due to the fact that the ajax initiator control has Static client id mode. If you set it to AutoId, the ajax callback happens without any problems. If you do not need it to be different for any of your controls, I would advise you to set the clientIdMode property in your web.config file:
<pages clientIDMode="AutoID" />

Additionally, have in mind that it is not recommended to ajaxify invisible controls. In such scenarios it is better to wrap the invisible control in a visible container and put it as an updated control in the ajax setting. Example attached.

All the best,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Al
Top achievements
Rank 1
answered on 24 May 2011, 03:22 PM
Thank you Tsvetina,

That seems to have fixed things for me.

I wasn't aware of the issue of ajaxifying invisible controls. I've never had any problems with it myself, but I'll bear it in mind for the future. If you can think of a simple example where it doesn't work then I would be interested to see a code example.

For anyone else looking into the problem, I have also found these:
http://ajaxcontroltoolkit.codeplex.com/workitem/26865
http://connectppe.microsoft.com/VisualStudio/feedback/details/596088/asp-4-0-clientidmode-predictable-causes-problems-with-updatepanel-when-using-ajax-control-toolkits-toolkitscriptmanager

Thanks again
Al
0
Tsvetina
Telerik team
answered on 25 May 2011, 12:16 PM
Hello Al,

Examples of issues related to ajaxifying invisible controls can be found in the forums, e.g.:

http://www.telerik.com/community/forums/aspnet-ajax/ajax/radajaxmanager-causing-events-to-fire-incorrectly.aspx

http://www.telerik.com/community/forums/aspnet-ajax/ajax/412484-sys-invalidoperationexception-could-not-find-updatepanel-with-id.aspx

http://www.telerik.com/community/forums/aspnet-ajax/docking/159204.aspx



All the best,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Ajax
Asked by
Al
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Tsvetina
Telerik team
Al
Top achievements
Rank 1
Share this question
or