Wednesday, March 21, 2012

Web page and User control

Good morning ladies and gents. I need a help with the following scenario:
I have a web page and two user controls.
a web page(ASPX) namedWebPage.aspx
a user control(ASCX) namedUserControl1.ascx
a user control(ASCX) namedUserControl2.ascx

TheWebPage.aspx has a user controlUserControl1.ascx bind to it and then user UserControl1.ascx hasUserControl2.ascx in it.(See below)
InsideUserControl2.ascx page a have a TabContainer control namedTabs. It has a methodOnClientActiveTabChanged="ActiveTabChanged".
ActiveTabChangedis JavaScript function (see below) inside aUserControl2.ascx

function ActiveTabChanged (sender, e)
{
__doPostBack('<%= Tabs.ClientID %>',sender.get_activeTab().get_headerText());
}
So basically when you switch from one TabPanel to another it should do a post back.
My problem is that Java Script function not getting triggered; it is only fires when I put it intoUserControl1.aspx but now facing a problem like "Tabs"control not exist onUserControl1.aspx .

My question is: How can I executeActiveTabChanged function to get a post back?

Thank you for your help.

Are you sure the real Tab.ClientId is written into the client code. You might want to compare what it is actually writting (you can do this with the source view on IE).


Yes, i did compare what's in the view source and it looks fine to me.

Thanks for reply

No comments:

Post a Comment