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

AjaxSettings for Page trying to access UserControl in MasterPage

1 Answer 58 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 23 Nov 2010, 05:30 PM
On my page I have a radgrid "rgdProductList" and I'm trying to add ajax settings to update a UserControl "Navigation" within the master page. Inside the UserControl "Navigation" I have a div with an id of "nav"

On Master Page:
<%@ Register Src="../Modules/Controls/nav.ascx" TagName="Navigation" TagPrefix="uc1" %>
...
<uc1:Navigation ID="Navigation" runat="server" />


On "Navigation" UserControl:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="nav.ascx.vb" Inherits="Modules_Controls_nav" %>
<div id="nav" runat="server" class="navigation">
    <!-- Inner Content Goes here -->
</div>


On "Products" page (which inherits that master page above): [NOTE: rgdProductList is a radgrid on the products page]
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
    Dim oNavigation As Modules_Controls_nav = DirectCast(Me.Master.Controls(0).FindControl("Navigation"), Modules_Controls_nav)
    RadAjaxManager.AjaxSettings.AddAjaxSetting(rgdProductList, oNavigation)
 
    Dim oNav As HtmlGenericControl = DirectCast(Me.Master.Controls(0).FindControl("Navigation").FindControl("nav"), HtmlGenericControl)
    RadAjaxManager.AjaxSettings.AddAjaxSetting(rgdProductList, oNav)
      
End Sub


As shown above, I tried adding AjaxSettings to both the UserControl itself as well as the inner div tag. I also tried adding a ajaxsetting to the master page, but it generates a radcodeblock error. I also tried wrapping the div tag in a update panel to no avail.

Any help on this subject would be GREATLY appreciated. NOTE: all other ajax settings on the page work fine and I don't see any JS errors. I tried adding a radloadingpanel and it did not show up for these ajax settings, but did for all other ajax settings on the page.

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 24 Nov 2010, 02:35 PM
Hi Michael,

Please go through the following help article which elaborates on this subject and see if it helps.
http://www.telerik.com/help/aspnet-ajax/ajxloadcontrolfromanotherwebusercontrolindifferentmasterpagecontentplaceholder.html

Additionally, to avoid the radcodeblock error simply wrap your JS code around RAdCodeBlock/ RadScriptBlock. For more details please visit: http://www.telerik.com/help/aspnet-ajax/ajxradscriptblockradcodeblock.html

Regards,
Pavlina
the Telerik team
Browse the vast support resources we have to jumpstart 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
Scott
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or