Sunday, March 11, 2012

Two questions about Tabs control

Hello!

Sorry, but my 1st questoin was incorrect. Solution was found here

http://forums.asp.net/p/1119252/1757482.aspx#1757482

Thanksmitkomk !

As for my 2nd question, currently I use this code in Page_Load

string controlName = Request.Params.Get("__EVENTTARGET");
string passedArgument = Request.Params.Get("__EVENTARGUMENT");

if (controlName == Tabs.ClientID)
{
string[] s = passedArgument.Split(':');
if ((s.Length == 2) && (s[0] == "activeTabChanged"))
{
Literal literal = new Literal();
switch (s[1])
{
case "0":
literal.Text = "Tab 1 clicked";
break;
case "1":
literal.Text = "Tab 2 clicked";
break;
case "2":
literal.Text = "Tab 3 clicked";
break;
}
ControlPalceHolder.Controls.Add(literal);
}
}

but it looks more like a trick than reliable programming. So, my 2nd question is still open.

Igor

No comments:

Post a Comment