TreeList AND Value in address bar

6 posts, 0 answers
  1. behnaz
    behnaz avatar
    5 posts
    Member since:
    Aug 2011

    Posted 09 Dec 2011 Link to this post

    hi,
    im using a rad tree list in my projects. its programmed in an user control, but i didn't load it directly, i load it from address bar, some things like this:
    ~/ManageDefault.aspx?type=MMPC&GrID=0
    when i use this way loading, the tree list dosen't work properly, when i load it directly from .aspx page, it works right, how i can fix it?
    all of my controls are in user controls, and i call them from code behind like previous link.

    thanks for your helpful replies...
  2. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 14 Dec 2011 Link to this post

    Hello Behnaz,

    From only the description we cannot know what is wrong with the RadTreeList control. First, how exactly do you use the query string, where, what code do you have? Then, what exactly does not work inside the treelist? The more details you provide, the higher is the chance that we manage to replicate and help you fix the issue.

    Best wishes,
    Tsvetina
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. behnaz
    behnaz avatar
    5 posts
    Member since:
    Aug 2011

    Posted 14 Dec 2011 Link to this post

    i have a tree list that is bonded hierarchically with datatable. when i want to open the childs tag, it doesn't work, and return to the father, but when i use it in aspx page, it works right! i realized that it matters from url, but i want to use user controls in my project, and have just one aspx default page...

    my code is ok, because it works in aspx page! and when drop the user control directly on page, it works! just when i call it from url, it does't work..
  5. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 14 Dec 2011 Link to this post

    Hi Behnaz,

    Please, provide the code you use to load the user controls and bind the RadTreeList. By default, there is no problem with having the control inside a dynamically loaded user control, as long as you load the user control correctly and bind the control as advised in our support resources.

    Additionally, can you confirm whether you use AJAX and if so, does the same scenario work with AJAX disabled?

    All the best,
    Tsvetina
    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
  6. behnaz
    behnaz avatar
    5 posts
    Member since:
    Aug 2011

    Posted 14 Dec 2011 Link to this post

    It's where i load controls dynamically in code behind (Page_Load):
    Panel1.Visible = false;
                if (Request["type"] != null)
                {
                    tbl_Links.Visible = false;
                    Panel1.Controls.Clear();
                    Panel1.Visible = true;
                    switch (Request["type"])
                    {
                        case "MHPC":
                            Panel1.Controls.Add(LoadControl("UserControls/M_MainPage.ascx"));
                            break;
                        case "MNC":
                            Panel1.Controls.Add(LoadControl("UserControls/M_News.ascx"));
                            break;
    }
                }

    it is binding function:
         private void BindData()
            {
                _menuCatBll = new MenuCategoryBLL();

                // Bind TreeList
                DataTable dt = _menuCatBll.GetAll();
                if (dt != null && dt.Rows.Count != 0)
                {
                    TL_Menu.DataSource = dt;
                }
            }

    about ajax:
    yes i tried it, its all right, just from loading the dynamically this problem appear!
  7. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 19 Dec 2011 Link to this post

    Hello Behnaz,

    One thing to confirm is that you reload the latest loaded user control on each postback, otherwise it is expected to misfunction:
    Load User Controls

    From what I see, you load a user control only when it is "requested" which is not supported, especially in an AJAX scenario.

    Greetings,
    Tsvetina
    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
UI for ASP.NET Ajax is Ready for VS 2017