Introduction to ComponentArt's TabStrip Control
page 5 of 6
by Nihar Nayak
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 28361/ 49

How to Access Controls inside Tabs

When you put other HTML or ASP.NET controls inside the MultiPage controls then you can't directly access them in server side. But in client side you can directly access them using document.getElementById.

Server Side Access

Suppose you have placed an Asp.NET Label control in one of the tabs. This control is not directly under the Page control. So you can't directly access it. You have to do the following:


MultiPage multipage = (MultiPage)Page.FindControl("MultiPage1");
PageView PageView1 = (PageView)multipage.FindControl("PageView1");
Label lblName = (Label)PageView1.FindControl("lblName");
lblName.Text = "Dynamically generated text";


As you can see, first we have to access the MultiPage control. Then under that the PageView control and after that our Label.


Client Side Access

There is no problem for accessing the controls in client side. You can directly access them as other normal controls, because while rendering the controls in HTML ComponentArt doesn't change the ID of the controls. They remain the same as specified while designing. So you can use the following line to access the Label :

document.getElementById("lblName").innerHTML = "Client text ";

View Entire Article

User Comments

Title: Very GOOD   
Name: SAI
Date: 2010-05-20 7:00:38 AM
Nice Thought process. People like you are are Good assets for company
Title: Good   
Name: Your Boss
Date: 2010-05-19 5:39:24 AM
Good one Nihar. Keep it up. Really I am missing you. I am not able to find a professional like you with all round knowledge like professional.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2023  |  Page Processed at 2023-09-25 7:18:45 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search