Poblem on Dynamic create RadTabStrip With Ajax

8 posts, 0 answers
  1. Peter
    Peter avatar
    15 posts
    Member since:
    Jul 2007

    Posted 07 Oct 2010 Link to this post

     Hi All,
    I have an issue with RadTabStrip control when I create this control at runtime by using ajax. I alsway have the js error:  "
    Microsoft JScript runtime error: Sys.ArgumentUndefinedException: Value cannot be undefined.
    Parameter name: type"
    Could you tell me how to solve this issue?

    Thanks,
    Peter.
    PS: Here is my code (I am using RAD2010Q1.NET3.5)

    protected override void OnInit(EventArgs e)
    {
    base.OnInit(e);
    try
    {
    ...
    ...
    RegisterUpdateControl();
    }
    catch (Exception ex)
    {
    DisplayErrors(ex.ToString());
    }
    }
    protected override void OnLoad(EventArgs e)
    {
    int height = 0;
    try
    {
    base.OnLoad(e);
    ......
    .....
    Test();
    }
    catch (System.Exception ex)
    {
    DisplayErrors(ex.toString);
    }
    }
    private AjaxSetting ajaxSetting2;
    private void RegisterUpdateControl()
    {
    ajaxSetting2 = new AjaxSetting();
    ajaxSetting2.AjaxControlID = "panelTest_ID";
    AjaxUpdatedControl control2 = new AjaxUpdatedControl();

    control2.ControlID = "panelTest_ID";
    control2.LoadingPanelID = this.ID + "loadingPanel";

    ajaxSetting2.UpdatedControls.Add(control2);
    this.radAjaxManager.AjaxSettings.Add(ajaxSetting2);

    //panelTest_ID
    }

     protected Panel panelTest;
    protected Button button;
    protected TextBox textbox;
    private void Test()
    {
    panelTest = new Panel();
    panelTest.ID = "panelTest_ID";
    textbox = new TextBox();
    textbox.ID = "textbox";
    panelTest.Controls.Add(textbox);
    button = new Button();
    button.ID = "Button";
    button.Text = "Ok";
    button.Click += new EventHandler(button_Click);
    panelTest.Controls.Add(button);
    this.Controls.Add(panelTest);
    }
    RadTabStrip tap;
    void button_Click(object sender, EventArgs e)
    {
    CreateTabTemp();
    }
    private void CreateTabTemp()
    {
    tap = new RadTabStrip();
    tap.TabClick += new RadTabStripEventHandler(tap_TabClick);
    tap.ID = "fdasdfasdf";
    tap.EnableAjaxSkinRendering = true;
    //tap.EnableEmbeddedScripts = true;
    //tap.EnableEmbeddedSkins = true;
    //tap.EnableSubLevelStyles = true;
    InitTabs();
    this.panelTest.Controls.Add(tap);
    }

    void tap_TabClick(object sender, RadTabStripEventArgs e)
    {
    string te = e.Tab.Value.ToString();
    }
    private void InitTabs()
    {
    for (int i = 0; i < 5; i++)
    {
    RadTab item = new RadTab("tab_" + i.ToString(), i.ToString());

    tap.Tabs.Add(item);
    }
    }
  2. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 11 Oct 2010 Link to this post

    Hi Peter,

    Thank you for the provided code. We tried to reproduce the issue locally, but without much success. Please find attached our test project.
    Could you please modify it with the exact your setup so we can examine the problem locally.

    Regards,
    Helen
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Peter
    Peter avatar
    15 posts
    Member since:
    Jul 2007

    Posted 12 Oct 2010 Link to this post

    Thanks Helen very much.
    I still have this issue. I am runing it on SharePoint 2010. I added them into my webpart and I have this issues.
    Thanks,
    Peter.
  5. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 18 Oct 2010 Link to this post

    Hello Peter,

    Unfortunately the information provided is not sufficient for us to provide more precise solution to you.

    Could you please open a support ticket and send us the whole web part with detailed instructions how to reproduce the issue?
    Thank you in advance.

    All the best,
    Kalina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Peter
    Peter avatar
    15 posts
    Member since:
    Jul 2007

    Posted 21 Oct 2010 Link to this post

    Many thanks Telerik team,
    I have solved my issue.
    Best Regard,
    Peter
  7. Saurin
    Saurin avatar
    2 posts
    Member since:
    Aug 2010

    Posted 30 Dec 2010 Link to this post

    Hi Peter,

    Do you mind sharing how you resolved your issue?

    Thanks,
    Saurin
  8. Larkin
    Larkin avatar
    11 posts
    Member since:
    Nov 2011

    Posted 12 Feb 2012 Link to this post

    I am having the same problem in SharePoint 2010, using a technique similar to the one shown in the demo site:

    http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/loadondemand/defaultcs.aspx

    If I ajaxify the tabstrip and set the updated control as the multipage, I get the above mentioned error when I try to click on one of the previous tabs.
  9. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 15 Feb 2012 Link to this post

    Hi Larkin,

    SharePoint has issues when the RadAjaxManager is declared at markup in a user control.
    You can overcome this by adding the RadAjaxManager at OnInit event of the web part.

    Additionally please add the AjaxSettings in this way:
    (I am not sure what the exact settings that you have defined are, so this sample only illustrates the approach that you can use.)

    private const string _ascxPath = @"~/_CONTROLTEMPLATES/SchedulerWebPartProject/SchedulerWebPart/VisualWebPart1UserControl.ascx";
       
    protected override void CreateChildControls()
    {
    }
       
    RadAjaxManager ajaxmgr;
    protected override void OnInit(EventArgs e)
    {
       
        base.OnInit(e);
       
        ajaxmgr = new RadAjaxManager();
        Page.Items.Add(typeof(RadAjaxManager), ajaxmgr);
        Page.Form.Controls.AddAt(0, ajaxmgr);
       
    }
       
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
       
        Control control = Page.LoadControl(_ascxPath);
        Controls.Add(control);
       
        RadTabStrip RadTabStrip1= control.FindControl("RadTabStrip1") as RadTabStrip;
        RadMultiPage RadMultiPage1= control.FindControl("RadMultiPage1") as RadMultiPage;
       
        ajaxmgr.AjaxSettings.AddAjaxSetting(RadTabStrip1, RadTabStrip1);
        ajaxmgr.AjaxSettings.AddAjaxSetting(RadTabStrip1, RadMultiPage1);
    }


    Regards,
    Kalina
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017