LoadOnDemand + Load Control from another UserControl + Access Properties

3 posts, 0 answers
  1. Mike
    Mike avatar
    20 posts
    Member since:
    Aug 2008

    Posted 23 Jan 2009 Link to this post

    Ok so i am using SiteFinity and playing with the RadToolTipManager. Because this is SiteFinity, my RadToolTipManager is inside a UserControl. That said i am trying to dynamically load the UserControl for the RadToolTipManager from this UserControl... Now that i have confused everyone sufficients, i am also trying to access properties within the RadToolTipManager Control i am loading Dynamically. I am frustrated cause none of the example on the Telerik site show the code behind of the user control.

    I need help and i need help BAD...

    So here are the details:

    Results.ascx.cs

    On an ItemDatabound mothd i add the control to the RadToolTipManager
    RadToolTipManager1.TargetControls.Add(((Label)rpti.FindControl("lblFlightNum")).ClientID, ""true); 

    As per the examples the code behind here has the following methods which the RadToolTipManager calles:
        protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args) 
        { 
            this.UpdateToolTip(args.Value, args.UpdatePanel); 
        } 
     
        private void UpdateToolTip(string elementID, UpdatePanel panel) 
        { 
            Control ctrl = Page.LoadControl("~/UserControls/PFV_3.0_TooltipControls/FlightInformation.ascx"); 
            panel.ContentTemplateContainer.Controls.Add(ctrl); 
     
            //ProductDetails details = (ProductDetails)ctrl;
            //details.ProductID = elementID; 
        } 

    Notice above i have commented out the lines where the property on the loaded control is accesses as i do not know how ProductDetails is inherited down and there is no explaination of this anywhere... If it were part of the ASPX page i might be able to access it but in my case it is part of a ASCX UserControl and being loaded dynamically.

    So here is my UserControl i am trying to LoadOnDemand

    FlightInformation.ascx.cs

    using System; 
    using System.Data; 
    using System.Configuration; 
    using System.Collections; 
    using System.Web; 
    using System.Web.Security; 
    using System.Web.UI; 
    using System.Web.UI.WebControls; 
    using System.Web.UI.WebControls.WebParts; 
    using System.Web.UI.HtmlControls; 
     
    public partial class UserControls_TooltipControls_FlightInformation : System.Web.UI.UserControl 
        string ParameterArray; 
        public virtual string Parameters 
        { 
            get 
            { 
                return ParameterArray; 
            } 
            set 
            { 
                ParameterArray = value; 
            } 
        } 
     
        protected void Page_Load(object sender, EventArgs e) 
        { 
     
        } 


    Can someone please help me load this control Dynamically and have access to it property from the OnAjaxUpdate method!

    Thanks in advance,

    Duncan


  2. Mike
    Mike avatar
    20 posts
    Member since:
    Aug 2008

    Posted 23 Jan 2009 Link to this post

    Disregard please. I have resolved this issue!

    Thanks
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. InfySam
    InfySam avatar
    8 posts
    Member since:
    May 2012

    Posted 10 May 2012 Link to this post

    Can you please post how you were able to resolve the issue. I am facing a similar issue. I have no idea why OnAjaxUpdate event isn't fired. On inspection into View Source I found that LoadOnDemand property of RadTooltipManager is set to false. I have no idea how to make this true because I suspect this will trigger OnAjaxUpdate event.
Back to Top