Thank you.
12 Answers, 1 is accepted
Thank you for your question.
The built-in AJAX of classic RadGrid was quite confusing for many customers -- as you probably know you cannot update controls outside the Grid though it. The RadAjax however does not suffer from this kind of limitations since you can configure RadAjaxManager to update controls even in a complex project (MasterPage/UserControls). The built-in AJAX in RadGrid would also conflict with the ASP.NET AJAX -- many people expect the Grid inside UpdatePanel for example to be able to update other controls in the same panel.
I also believe adding and configuring the AJAX Manager is a trivial task especially when we talk about Grid -> Grid setting. You can refer to Prometheus Grid online demos, which mostly use this approach (we will update all the demos to have an AJAX Manager updating the Grids). This actually concerns the Prometheus Quick Start Framework demos at all.
I hope this explains our decision. Should you have other questions, feel free to ask.
Best wishes,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Yes, that explains things, I understand and agree with your decision to move in this direction.
By the way, the inclusion of the new RadScriptManger control with the Q3 release removes my concerns for implementing a lot of different controls on one page; as I can now improve the performance by using the option of combining all the scripts into one request. Brilliant work on that feature. Thank you for the quick reply.
I have an application using master and content pages. Per telerik recommendations, I have a RadAjaxManager in my master page. I also have a Prometheus RadGrid inside of a user control that is loaded into a content page. I'm trying to use Prometheus RadWindow as my edit form for items in the grid. I can bring the window up just fine using RadGrid ClientEvent "OnRowSelected". Upon saving data and closing the RadWindow, I want to rebind the grid to show the saved data. I know RadAjaxManager has a method "OnAjaxRequest" that might be useful to me, but I can't figure out how I would use that since the Manager is in the master page and the grid I want updated is not. Any assistance?
You can get the manager instance through GetCurrent() method in a JS function called on window close, call manager's AjaxRequest client-side with an argument say "rebind", hook AjaxRequest server-side event and if the argument is the required, just call RadGrid.Rebind(). All the "magic" requires several lines of code only. Something similar is demonstrated here but the demo there does not contain master/content page, calls AjaxRequest of the Grid with AJAX mode and of course, it uses the classic controls.
Let me know if you need further assistance.
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I tried it this way: $find("<%= RadAjaxManager1.ClientID %>").AjaxRequest('test'). Got this long-winded error: Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '$find("ctl00_RadAjax'. But this didn't occur until AFTER the server side OnAjaxRequest event fired. (NOTE: For some reason the error message $find("ctl00_RadAjax' did not include the entire name of the control I was trying to find.
This is my aspx:
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="lblTest" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadCodeBlock ID="cb1" runat="server">
<script type="text/javascript">
function InitiateAjaxRequest(arguments)
{
$find("<%= RadAjaxManager1.ClientID %>").AjaxRequest(arguments);
}
</script>
</telerik:RadCodeBlock>
<input type="button" value="test" id="testButton" runat="server" />
<asp:Label ID="lblTest" runat="server" Text="BRAINS" />
You can check this example for more info:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Ajax/Examples/Manager/ClientSideAPI/DefaultCS.aspx
Vlad
Now, I'm getting another issue that I did not notice before...javascript issues. Let me lay out the scenario for you so you understand and can hopefully help me.
1. Master page has a RadAjaxManager and a RadTabStrip.
2. Clicking on a tab dynamically loads a UserControl (I used the code found in several examples for doing this) into the Default.aspx content page.
3. The UserControl has a Prometheus RadGrid and RadWindow. When the user selects a row, a javascript function is called to load that record in the RadWindow for editing. The script function, "RadGrid_RowSelected", I built directly into the ascx.
Now, when I click on a tab in the master to load this UserControl, it loads but then I'm getting random javascript errors. For awhile, I was getting an error saying that "RadGrid_RowSelected" was null or not an object. Now, that function is working but I'm getting an error when loading the RadWindow of "Microsoft JScript runtime error: 'length' is null or not an object" occurring in ScriptResource.axd. Here is a snippet of the function that's erroring (I assume it's a built-in RadWindow javascript function):
getWindowByName:
function(_27){
var _28=this.get_windows();
for(var i=0;i<_28.length;i++){
var _2a=_28[i];
if(_27==_2a.get_name()){
return _2a;
}
}
Now, when I load the control dynamically directly from Default.aspx instead of from the master page, the same code works perfectly. Thoughts?
Thank you for the explanation.
Although I am not sure what the exact source of the issue can be, can you please verify that you load the user control holding the grid instance in par with the conventions depicted in these resources:
http://www.telerik.com/help/aspnet/grid/?grdUserControlRuntimeLoad.html
http://www.telerik.com/help/aspnet/ajax/?ajxLoadUserControls.html
This should ensure that the controls viewstate will be consistent and their event lifecycle will remain intact. Additionally, note that you may need to use RadCodeBlock to wrap the your javascript code for RadGrid Prometheus:
http://www.telerik.com/help/radcontrols/prometheus/?grdMigrationToPrometheus.html
If the problem with the RadWindow instance persists, I suggest you prepare a stripped working version of your project and send it attached to a formal support ticket. We will review your entire code implementation and will get back to you with our findings.
Kind regards,
Stephen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Now I'm dealing with the RadGrid being in a dynamically loaded user control. I can do sorting without issue, I can click a row and load a RadWindow to edit without issue (and have it rebind the grid after 'save'), but for some reason, I cannot rebind the grid from a dynamically created LinkButton. I have the RadGrid being built in Page_Init, and the LinkButton in Page_Load. I have the LinkButton wired up w/ Ajax to update the RadGrid. When you click the button it runs through all the code to rebind the grid and after all the code you can debug is finished, this javascript error occurs: Microsoft JScript runtime error: Sys.ArgumentException: Value must not be null for Controls and Behaviors. Parameter name: element.
I'm fairly new to Ajax and these issues are absolutely driving me crazy. I will send a small project when I can, but I'm in the middle of trying to hit a deadline so it's hard to make time to do that. I know you guys are great with support, if there's anyway someone there could throw together a quickie project to test under the following guidelines, that would be great:
1. Master page dynamically loads a user control into the content place holder. This user control has a ScriptManagerProxy, RadAjaxManagerProxy, and two panels: one for dynamically loading a Prometheus RadGrid, one for dynamically loading a LinkButton that should rebind the grid.
2. I have the RadGrid setup to update itself via RadAjaxManagerProxy, and after dynamically loading the LinkButton, I have the LinkButton setup to update the RadGrid via RadAjaxManagerProxy.
The error should occur when clicking the LinkButton. Thanks!
I think that the information from the following forum thread in the ASP.NET AJAX forums can get you on the right path in solving the problem you are currently facing:
http://forums.asp.net/t/1038420.aspx
If you are not able to address the issue yourself, please isolate a working subset of your project and send it enclosed to a formal support ticket. This will greatly speed up the resolution of the problem as thus I will be able to debug your code locally and give you straight-to-the-point explanation/fix.
Best regards,
Stephen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
In my case I am declaring an ajax setting declaratively using the ajax proxy control on my aspx page. However, the loading panel doesn't show when I use the declarative syntax.
So I switched to the programmatic ajax setting and my loading panel shows but not i get controls and behaviors error.
Switch it back to declarative way - no loading panel but at least no error.
Switch to programmatic way - get a loading panel but a controls and behaviors error.
That is the only difference in my code between getting the error and not getting the error.
Prometheus is the most frustrating thing in the world. Our productivity is down 50% since switching to prometheus because of stuff like this - that we never had before in the old, much more reliable, rad ajax framework.
I am sorry to hear that you are having a hard time migrating to our Prometheus controls and taking advantage of the new capabilities exposed by the ASP.NET AJAX framework and RadAjax Prometheus in particular. However, as sburk from MS said in the public forum post linked in my previous reply:
That exception comes from the ASP.NET AJAX framework. It's basically saying that it was unable to find the element that a behavior is attached to. There's not enough info here to debug more than that. Make sure the target element is being rendered to the page and also see the Caveat on my posting (at the top of the forum) about templates and repeaters.
Therefore, it seems that a control from the Ajax toolkit generates the exception you receive. Since RadAjaxManager Prometheus dynamically "injects" MS UpdatePanels around the ajaxified controls, the same issue will probably surface if you remove the RadAjaxManager and use standard UpdatePanels in the same scenario.
If the issue seems to be elsewhere, please prepare a stripped working version of your project and send it enclosed to a formal support ticket. Thus we can test/debug the demo and provide more accurate answer/solution.
Best regards,
Stephen Rahnev,
Technical Support Director, Telerik
Instantly find answers to your questions at the new Telerik Support Center