This is a migrated thread and some comments may be shown as answers.

Poblem on Dynamic create RadTabStrip With Ajax

7 Answers 160 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 07 Oct 2010, 11:18 AM
 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);
}
}

7 Answers, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 11 Oct 2010, 12:28 PM
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
0
Peter
Top achievements
Rank 1
answered on 12 Oct 2010, 08:10 AM
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.
0
Kalina
Telerik team
answered on 18 Oct 2010, 02:27 PM
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
0
Peter
Top achievements
Rank 1
answered on 22 Oct 2010, 04:02 AM
Many thanks Telerik team,
I have solved my issue.
Best Regard,
Peter
0
Saurin
Top achievements
Rank 1
answered on 30 Dec 2010, 10:39 PM
Hi Peter,

Do you mind sharing how you resolved your issue?

Thanks,
Saurin
0
Larkin
Top achievements
Rank 1
answered on 12 Feb 2012, 10:21 AM
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.
0
Kalina
Telerik team
answered on 15 Feb 2012, 03:04 PM
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 >>
Tags
TabStrip
Asked by
Peter
Top achievements
Rank 1
Answers by
Helen
Telerik team
Peter
Top achievements
Rank 1
Kalina
Telerik team
Saurin
Top achievements
Rank 1
Larkin
Top achievements
Rank 1
Share this question
or