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

Add new tab in asp.net and reflect that on UI.

2 Answers 37 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Susheel
Top achievements
Rank 1
Susheel asked on 31 Mar 2015, 08:04 AM
Hi,

i have written code to add new tab and the code is : 

RadTabStrip objRadTabStrip = (RadTabStrip)Page.Master.FindControl("DefaultContent").FindControl("radTabStrip1");
RadTab objChildTab = new RadTab();

      objChildTab.Text = objTabItem.TabText;
     objChildTab.Value = objTabItem.TabValue;
     objChildTab.PageViewID = objTabItem.PageViewID;
     objChildTab.ToolTip = objTabItem.TabURL;
     objRadTabStrip.Tabs.Add(objChildTab);
     objRadTabStrip.DataBind();

this code is written on button click which is present on user control(.ascx) page.
user control is called in demo.aspx page and this demo.aspx page is called from some other page.
So when i add new tab at that time it not visible on UI but if i refresh the whole page the it gets visible and it takes too much time to refresh full page.

I want as soon as i click on add new tab button the newly crated tab should be visible on UI.

Please help me to do this.

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 02 Apr 2015, 07:05 AM

Hi Susheel,

A likely reason for such behavior is that you are using AJAX for the button click and the server response does not include the RadTabStrip. In this case, changes you make on the server will not reflect on the client until the control in question participates in the response - either gets included in the partial rendering, or a full postback occurs.

If modifying the way you use AJAX is not an option, I can suggeset adding the tab on the client: http://www.telerik.com/help/aspnet-ajax/tabstrip-tab-client-side.html. If you must definitely go through the server code, you can register the call to the needed script as explained here: http://www.telerik.com/help/aspnet-ajax/window-troubleshooting-javascript-from-server-side.html.

Regards,

Marin Bratanov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Susheel
Top achievements
Rank 1
answered on 02 Apr 2015, 11:00 AM
Hi Marin,

Thanks A Lot your suggestion on Ajax worked for me.

Regards,
Susheel
Tags
General Discussions
Asked by
Susheel
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Susheel
Top achievements
Rank 1
Share this question
or