AjaxSettings for Page trying to access UserControl in MasterPage

2 posts, 0 answers
  1. Scott
    Scott avatar
    4 posts
    Member since:
    Sep 2008

    Posted 23 Nov 2010 Link to this post

    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.

  2. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 24 Nov 2010 Link to this post

    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.
Back to Top