2 posts, 0 answers
  1. Kjell
    Kjell avatar
    223 posts
    Member since:
    May 2011

    Posted 27 Nov 2012 Link to this post

    Have problem to load my TreeView using "Public Sub buildTree()" and InitialPageLoad...
    What can I possibly do wrong ....

        <telerik:RadAjaxManager ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest" runat="server">
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                        <telerik:AjaxUpdatedControl ControlID="PanelLoad" />
            <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function RequestStart(sender, eventArgs) {
                    $get("<%=modalDiv.ClientID %>").style.display = "block";
                function ResponseEnd(sender, eventArgs) {
                    $get("<%=modalDiv.ClientID %>").style.display = "none";
                function pageLoad(sender, eventArgs) {
                    if (!eventArgs.get_isPartialLoad()) {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("InitialPageLoad");
    <asp:Panel ID="PanelLoad" Visible="False" Style="padding-left: 6px; padding-top:6px;" runat="server">
    My TreeView databind using the "Public Sub buildTree()"
        <div id="modalDiv" style="position: absolute; top: 40px; left: 0px; height: 3000px; width: 100%; z-index: 100; background: gray; display: none; opacity: 0.3; filter: alpha(opacity=100);" runat="server" />
    Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs)
        If e.Argument = "InitialPageLoad" Then
            PanelLoad.Visible = True
        End If
    End Sub
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
        End If
    End Sub
    Public Sub buildTree()
        Dim MyConnection As New SqlConnection(System.Configuration..................
        Dim MyDataAdapter As New SqlDataAdapter("select NodeId, ParentNodeId................
        Dim DS As New DataSet()
  2. Marin
    Marin avatar
    1057 posts

    Posted 30 Nov 2012 Link to this post


     You should make sure that the buildTree() function is executed when you perform an ajax request. You may need to revise the current condition in the Page_Load event (If Not Page.IsPostBack Then
    ) which will be false in the case of an ajax request and the procedure will not be executed at all.

    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top