This project is read-only.

Aspnet controls and ajax

Sep 24, 2010 at 12:33 PM


I'm using a telerik:RadWindow control in a template - got code from a samples of yours :-)

It's working perfectly, but I have a small issue I cannot solve. The control is declared like this:

<xsl:text disable-output-escaping="yes"><![CDATA[
	<%@ Register
	   Assembly="Telerik.Web.UI" %>
<mdo:asp xmlns:asp="asp" xmlns:telerik="telerik">
	<telerik:RadWindow ID="wnd" runat="server">
			<div id="popup" />

The problem is the CDATA, which is necessary to let this declaration valid within the xslt, but that is shown on screen when I have an mdo:ajax call: that is after firing the mdo:ajax call (I have two select, the second loading depending on the first), I can see the declaration inline:

<select name="idRegione" onchange="{mdo:ajax()}">

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
... Rest of HTML ...

That declaration is not visibile before I call mdo:ajax.

I did some tests, and don't think the position of the control declaration within the template does matter, that is an mdo:ajax call does actually reload the entire module. Did you ever match a similar problem?

Sep 24, 2010 at 6:28 PM

First of all, XsltDb ajax is not compatible with ASP.NET controls. You have to use ASP.NET ajax instead. You can activate ASP.NET ajax for all instances of XsltDb by setting "Supports Partial Rendering?" for XsltDb View control (Host / ModuleDefinitions / XsltDb / ModuleControls / ViewXsltDb.ascx). Or you can manually create ScriptManager and other ASP.NET AJAX components in the particular module.

XsltDb AJAX is something different than ASP.NET AJAX and it is much faster that ASP.NET AJAX. So you must separate your ASP.NET controls from areas that are "AJAX-ed" via XsltDb AJAX. there are two ways of doing that:

  1. Using <noajax> tag.
  2. Putting ASP.NET controls in separate module

And one more tip: In current version you can remove telerik prefix declaration for Telerik.Web.UI and Telerik. Charting name spaces. they are added automatically when page is loaded.

noajax tag is not documented yet. All code inside <noajax> is not sent to the client if mdo:ajax is processed. so if you enclose your ASP.NET object in <noajax> you can avoid displaying ASP.NET tags after AJAX is occured. But remember that <noajax> content goes exactly above other content of module.

Simple sample:

  <script type="text/javascript">
    // this script will never be reloaded and re-executed when module is refreshed via mdo:ajax

   <!-- this section is re-created each time ajax refresh is happened -->

Using noajax remember: XSL inside noajax is executed each time module refreshed but if it is page request execution - noajax results are included in output and are put on the top of other content. If it is AJAX request processing - noajax section is cut from output.

Sep 27, 2010 at 3:55 PM


the "noajax" trick solved my problem, great :-)

Is there something similar to simulate the use of different updatepanels? Say I have two areas which I want to update via ajax: as far as I know any mdo:ajax call will impact on all content (excluding what is in NOAJAX sections off course), or would it be possible to limit this within some area?

For example say you have a jquery ui tabs control that dynamically loads, via ajax calls, the content of its tabs: when a function to load a tab's content is called, only that tab should be updated - not the entire module. In a normal DNN module I use different updatepanels, with xsltdb how could I do?