Issue grabbing correct control/update panel in repeater - c#

I'm having issues with dynamically updating a drop down list control when it is inside a repeater.
Basically I have a repeater and inside that repeater are 2 drop down lists. The one list is defined in my aspx page, the other drop down list is inside an update panel where I want to be able to have it dynamically update based on the selection of the first drop down list. I think part of my problem is the updatepanel is getting confused because I have more than one repeater item?
Here is the code for my repeater:
<asp:Repeater ID="billingTemplate" runat="server" OnItemDataBound="template_ItemDataBound">
<ItemTemplate>
<tr style="font-size: 100%" runat="server">
<td colspan="4" style="width: 100%; vertical-align: top">
<div class="panel panel-default panel-billing">
<asp:Panel CssClass="row panel-heading panel-heading-billing text-left" ID="headingBilling" ClientIDMode="Static" runat="server">
<div class="col-xs-1">
<input type="hidden" id="templateUK" runat="server" value='<%#Eval("templateUK")%>' />
</div>
<div class="col-sm-3">
<label for="ddlInvFilterType" class="col-sm-4 control-label text-right labelCls testclass">Filter Type:</label>
<div class="col-sm-8">
<asp:DropDownList runat="server" ID="ddlInvFilterType" ClientIDMode="Static" placeholder="Choose Filter Type" CssClass="form-control smallSize FilterType" AutoPostBack="true" OnSelectedIndexChanged="ddlFilterType_SelectedIndexChanged">
<asp:ListItem Value="">- None -</asp:ListItem>
<asp:ListItem Value="RevType1">Revenue Type 1</asp:ListItem>
<asp:ListItem Value="RevType2">Revenue Type 2</asp:ListItem>
<asp:ListItem Value="RevType3">Revenue Type 3</asp:ListItem>
<asp:ListItem Value="ServiceTeams">Service Team</asp:ListItem>
</asp:DropDownList>
</div>
</div>
<asp:UpdatePanel ID="InvFilterValuePanel" ClientIDMode="Static" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<div class="col-sm-3">
<label for="ddlInvFilterValue" class="col-sm-4 control-label text-right labelCls">Filter Value:</label>
<div class="col-sm-8">
<asp:DropDownList runat="server" ID="ddlInvFilterValue" ClientIDMode="Static" placeholder="Choose Filter Value" CssClass="col-sm-6 form-control smallSize">
<asp:ListItem Value="">- None -</asp:ListItem>
</asp:DropDownList>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlInvFilterType" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</asp:Panel>
<asp:Panel CssClass="panel-collapse collapse" ID="collapseBilling" ClientIDMode="Static" runat="server">
<div class="panel-body">
<table class="table table-condensed table-bordered" style="margin: 0; padding: 0; border-top: none; border-bottom: none; border-left: thin; border-right: thin">
<tbody>
<%-- other controls --%>
</tbody>
</table>
</div>
</asp:Panel>
</div>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
Heres the code for my selected index change:
protected void ddlFilterType_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
DropDownList ddl = (DropDownList)sender;
string ddlClass = ddl.CssClass;
string[] classes = ddlClass.Split(' ');
string repeaterClass = classes[classes.Length - 1];
string repeaterID = "0";
string appendStr = "";
if (repeaterClass.Contains("templateID"))
{
repeaterID = repeaterClass.Substring(repeaterClass.Length - 1);
appendStr = "_" + repeaterID;
}
foreach (RepeaterItem item in billingTemplate.Items)
{
HtmlInputHidden hidden = item.FindControl("headingBilling").FindControl("templateUK") as HtmlInputHidden;
if (hidden.Value == repeaterID)
{
DropDownList d1 = item.FindControl("headingBilling").FindControl("ddlInvFilterType") as DropDownList;
DropDownList d2 = item.FindControl("headingBilling").FindControl("ddlInvFilterValue") as DropDownList;
if (d1.SelectedValue.Length > 0)
{
d2.Items.Clear();
d2.Items.Add(new ListItem(" - None - ", ""));
switch (d1.SelectedValue)
{
case "ServiceTeams":
foreach (var pair in serviceTeamsController.GetAllServiceTeamsLOVs())
{
if (!String.IsNullOrWhiteSpace(pair.Value))
d2.Items.Add(new ListItem(pair.Value, pair.Key));
}
break;
default:
foreach (var pair in masterController.GetMasterLOVs(filterTypeDict[d1.SelectedValue]))
{
if (!String.IsNullOrWhiteSpace(pair.Value))
{
d2.Items.Add(new ListItem(pair.Value, pair.Key));
}
}
break;
}
}
else
{
d2.Items.Clear();
d2.Items.Add(new ListItem(" - None - ", ""));
}
}
}
}
catch (Exception ex)
{
}
}
Heres a screenshot of what I'm looking at when theres more than one repeater item:
Basically whats happening now is if I update the filter type in item2 it will update the filter value in item 1. If I update the filter type in item1 it will update the filter value in item 1 as expected.
What I want is to be able to update item2 filter type and then the filter value in item 2 is updated accordingly.
Anyone have any ideas on what I could be missing?

So ended up getting this to work, I think the main issue was the clientidmode was confusing the update panel somehow, so I removed that and made the update panel go around both drop downs. I also didnt end up needing the trigger so I removed that as well.

Related

Retrieving CheckBoxList Values in Function

I have a cblSchedule checkboxlist in my .ascx page that allows selection of Daily/Weekly:
<div class="form-group" id="schedule">
<label class="control-label col-md-2" id="lblSchedule">Schedule</label>
<div class="col-md-3">
<div class="input-group">
<asp:CheckboxList ID="cblSchedule" ClientIDMode="Static" CssClass="chkLabel" runat="server" AutoPostBack="false" CellPadding="5" CellSpacing="5" RepeatDirection="Horizontal" RepeatLayout="Table" onchange="ToggleSchedule(this)" >
<asp:ListItem Text="Daily" Value="Daily"></asp:ListItem>
<asp:ListItem Text="Weekly" Value="Weekly"></asp:ListItem>
</asp:CheckboxList>
</div>
</div>
</div>
There is a chkSelectDay checkboxlist displayed when Weekly is checked:
<div class="form-group" id="divSelectDay" >
<label class="control-label col-md-2" id="lblSelectDay">Select Day of Week</label>
<div class="col-md-3">
<div class="input-group">
<asp:CheckBoxList ID="chkSelectDay" CssClass="chkLabel" ClientIDMode="Static" runat="server" AutoPostBack="false" CellPadding="5" CellSpacing="5" RepeatDirection="Horizontal" RepeatLayout="Table">
<asp:ListItem Value="Monday">Mon</asp:ListItem>
<asp:ListItem Value="Tuesday">Tue</asp:ListItem>
<asp:ListItem Value="Wednesday">Wed</asp:ListItem>
<asp:ListItem Value="Thursday">Thu</asp:ListItem>
<asp:ListItem Value="Friday">Fri</asp:ListItem>
<asp:ListItem Value="Saturday">Sat</asp:ListItem>
<asp:ListItem Value="Sunday">Sun</asp:ListItem>
</asp:CheckBoxList>
</div>
</div>
</div>
I have a toggle function that display/hide chkSelectDay when Weekly is checked/unchecked in cblSchedule :
function ToggleSchedule(controlId) {
var frmControl = document.getElementById(controlId.id);
var divDay = document.getElementById("divSelectDay");
var checkbox = frmControl.getElementsByTagName("input");
var counter = 0;
for (var i = 0; i < checkbox.length; i++) {
if (checkbox[i].checked)
{
if (checkbox[i].value == "Weekly")
divDay.style.display = 'block';
}
else
{
if (checkbox[i].value == "Weekly") {
divDay.style.display = 'none';
//UNCHECK ALL chkSelectDay checkboxes <--
}
}
}
}
I would like to add in the functionality of unchecking all checkboxes in chkSelectDay when Weekly is unchecked in cblSchedule.
I tried to retrieve checkbox count via $('#chkSelectDay').
But I was unable to use .Count nor .Length, so I can't use a for-loop to set .Checked = false.
Thank you
First thing you should know is by default CheckBoxList stores its value inside ViewState and not show it in client-side. You need to add ClientValue attribute inside ListItem to let checkboxlist values available in client-side:
<asp:CheckboxList ID="cblSchedule" ClientIDMode="Static" CssClass="chkLabel" runat="server" AutoPostBack="false" CellPadding="5" CellSpacing="5" RepeatDirection="Horizontal" RepeatLayout="Table" onchange="ToggleSchedule(this)" >
<asp:ListItem Text="Daily" Value="Daily" ClientValue="Daily"></asp:ListItem>
<asp:ListItem Text="Weekly" Value="Weekly" ClientValue="Weekly"></asp:ListItem>
</asp:CheckboxList>
Then, handle change event to make sure that the Weekly value is passed, otherwise uncheck all of chkSelectDay checkboxes:
$("#cblSchedule input[type=checkbox]").change(function () {
var value = $(this).parent().attr('clientvalue');
// check if the value is 'weekly'
if (this.checked && value != "Weekly") {
// set all day selection checkboxes to 'unchecked'
$("[id*=chkSelectDay] input").removeAttr("checked");
// hide day selection checkboxes
$('#divSelectDay').css('display', 'none');
}
else {
// do something else
}
});
Related issues:
Get the Checkboxlist value when unchecked Client-Side
Check uncheck all CheckBoxes on the basis of another CheckBox
ASP.Net CheckBoxList: Check or uncheck all checkboxes client side using jQuery

in ASP.NET Add dynamic radiobutonlist inside a div which is inside a listview

I have a listview that contains divs in rows. All divs have there own controls working. One div contains radiobuttonlist which is getting data source from codebehind. The data is populated but the radiobuttonlist is carried outside of the relevent div.
Any help will be appreciated.
<div id="riDiv" class="rightDiv" runat="server">
<asp:ListView runat="server" ID="lvItemDetails" style="border:solid; border-color:blue; border-width:10px;">
<LayoutTemplate>
<div>
<table>
<tr runat="server" id="itemplaceholder" class="TopboxDiv">
</tr>
<tr runat="server" id="itemPlaceHolder2">
</tr>
</table>
</div>
</LayoutTemplate>
<ItemTemplate>
<tr>
<div class="TopboxDiv">
<asp:Literal ID="litItemDesc" Text='<%# ".." + Eval("item_description") %>' runat="server" />
</div>
</tr>
<tr>
<div class="MidboxDivWrapper" runat="server">
<div class="leftTagDiv">
<div class="pc">Price</div>
</div>
<div id="middiv" class="MidboxDiv" runat="server">
<%--<div id="innerRadDiv">--%>
<asp:Panel runat="server" ID="pnlMidBoxDiv" BorderStyle="Solid" BorderColor="Pink" BackColor="Aqua" style="z-index:2 !important;">
<span>
<asp:RadioButtonList ID="rdCrService" runat="server" DataTextField="ServiceName" DataValueField="ServiceName" RepeatDirection="Horizontal" CssClass="radioDiv" >
</asp:RadioButtonList>
</span>
</asp:Panel>
<%--</div>--%>
<div class="radioDiv">
<asp:RadioButton id="rdPost" Text="Postoffice Price" runat="server" CssClass="radiotext" GroupName="radPriceGroup" />
<asp:Literal ID="litPost" Text="Rs. 100" runat="server" />
</div>
<%--<div class="radioDiv">
<asp:RadioButton id="rdOCS" Text="OCS Price" runat="server" CssClass="radiotext" GroupName="radPriceGroup"/>
<asp:Literal ID="litOCS" Text="Rs. 110" runat="server" />
</div>
<div class="radioDiv">
<asp:RadioButton id="rdTCS" Text="TCS Price" runat="server" CssClass="radiotext" GroupName="radPriceGroup"/>
<asp:Literal ID="litTCS" Text="Rs. 120" runat="server" />
</div>
<div class="radioDiv">
<asp:RadioButton id="rdOther" Text="Other Price" runat="server" CssClass="radiotext" GroupName="radPriceGroup"/>
<asp:Literal ID="litOther" Text="Rs. 120" runat="server" />
</div>--%>
</div>
</div>
</tr>
<tr>
<div class="bottomDivItemWrapper">
<div class="leftTagDiv">
<div class="pc">Color</div>
</div>
<div class="bottomDivItem">
<div class="radioDiv">
<%--<asp:RadioButton ID="Rad1" Text='<%# Eval("ServiceName") %>' runat="server" GroupName="testGrp" CssClass="radiotext"/>--%>
<asp:RadioButton id="rdWhite" Text="white" runat="server" CssClass="radiotext" />
</div>
</div>
</div>
<div class="OrderDivWrapper">
add cart and wishlist buttons. write cart and wishlist code functions so it can be called again and again.
</div>
</tr>
</ItemTemplate>
</asp:ListView>
</div>
This is a pretty contrived example, but it's possible to databind the Radio Button Lists too. Below is an example; it's admittedly rather contrived, but it works.
First, the code-behind (including how I'm constructing the list). The details of getRandomString and getRandomListOfStrings aren't all that important - basically, I'm just generating random data to populate the front-end with. Obviously, you'll want to replace this with whatever your actual data source is.
private class Temp
{
public string MainName { get; set; }
// This is probably the key point here - I create a property to
// hold data to bind my radio buttons to
public List<string> RadioButtonOptions { get; set; }
}
private string getRandomString(Random r)
{
var sb = new StringBuilder();
int length = r.Next(3, 10);
for (int i = 0; i < length; i++)
{
int chr = r.Next(0, 60);
char result = (char)(33 + chr);
sb.Append(result);
}
return sb.ToString();
}
private List<string> getRandomListOfStrings(Random r)
{
int listLength = r.Next(3, 6);
var list = new List<string>();
for (int i = 0; i < listLength; i++)
{
list.Add(getRandomString(r));
}
return list;
}
protected void Page_Load(object sender, EventArgs e)
{
Random r = new Random();
var list = new List<Temp>
{
new Temp
{
MainName = getRandomString(r),
RadioButtonOptions = getRandomListOfStrings(r)
},
new Temp
{
MainName = getRandomString(r),
RadioButtonOptions = getRandomListOfStrings(r)
},
new Temp
{
MainName = getRandomString(r),
RadioButtonOptions = getRandomListOfStrings(r)
},
new Temp
{
MainName = getRandomString(r),
RadioButtonOptions = getRandomListOfStrings(r)
},
new Temp
{
MainName = getRandomString(r),
RadioButtonOptions = getRandomListOfStrings(r)
},
new Temp
{
MainName = getRandomString(r),
RadioButtonOptions = getRandomListOfStrings(r)
},
new Temp
{
MainName = getRandomString(r),
RadioButtonOptions = getRandomListOfStrings(r)
}
};
mainListView.DataSource = list;
mainListView.DataBind();
And the front end code:
<asp:ListView ID="mainListView" runat="server">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("MainName") %>' /><br />
<asp:RadioButtonList runat="server" DataSource='<%# Eval("RadioButtonOptions") %>'/><br />
<hr />
</ItemTemplate>
</asp:ListView>
The HTML for the radio buttons looks like this:
<tr>
<td><input id="mainListView_ctl01_1_0_1" type="radio" name="mainListView$ctrl1$ctl01" value="6U(" /><label for="mainListView_ctl01_1_0_1">6U(</label></td>
</tr>
And the front end looks something like this:

How to know which item is selected in the ListView in asp.net

I have a Listview which I have used to display messages.Along with each message there is a link to "Reply" message.Since different user can send message to one user.The user have different message from different user.Now i need to track each user who are sending message.I was wondering if there is a way to know which message is selected so that the sender's id can be traced.
Here is my List view.
<asp:ListView ID="msg_list" runat="server">
<ItemTemplate>
<table>
<tr class="myitem">
<td>
<asp:Label role="menuitem" ID="msg_lbl" runat="server" text='<%#Eval("msg")%>' /><i style=" color:Gray; " > from
<asp:Label ID="tme" runat="server" Text='<%#Eval("name")%>' />
<i> on </i>
<asp:Label ID="tmelbl" runat="server" Text='<%#Eval("tme")%>'/>
<a id="msg-reply" class="btn button" data-toggle="modal" data-target="#msg-rply" style="cursor:pointer;" ><i class="glyphicon glyphicon-share-alt white"> </i></a> </td>
<hr style=" margin-top:1px; margin-bottom:1px; " />
</tr>
</table>
<%--<hr style=" margin-top:1px; margin-bottom:1px; " />--%>
</ItemTemplate>
</asp:ListView>
With this list view i display the messages.In the above code you can see this line <a id="msg-reply" class="btn button" data-toggle="modal" data-target="#msg-rply" style="cursor:pointer;" ><i class="glyphicon glyphicon-share-alt white"> </i></a> </td>
So,when I click the icon a lightbox appears(modal of bootstrap) where i can write my message.
This lightbox has a button to send message(insert to database) which is as follows.
public void reply_msg(object sender, EventArgs e)
{
string tym = DateTime.Now.ToString();
string sid = Session["userid"].ToString();
//string rid = ((Label)msg_list.FindControl("easy")).Text;
//Label mr = (Label)msg_list.FindControl("reg_id_reply");
// string rid = mr.Text;
string rid = Session["msgreply"].ToString();
//msg_list.Items.FindControl("easy");
sc.connection();
SqlCommand cmd = new SqlCommand("insert into message(msg,senderId,receiverId,tme) values( #msg,#sid,#rid,#tme) ", sc.con);
cmd.Parameters.AddWithValue("#msg", ReplyMsgTb.Text);
cmd.Parameters.AddWithValue("#sid", sid);
cmd.Parameters.AddWithValue("#rid", rid);
cmd.Parameters.AddWithValue("#tme", tym);
cmd.ExecuteNonQuery();
sc.con.Dispose();
sc.con.Close();
}
What i need is to know which item of ListView is selected when i click the icon that brings out the lightbox to send message.
OR is there any other way to know which item of Listview is selected.
You can use check box with every row. So when the user checks the check box for the particular row you can easily reply to the selected user.
your code will be something like this:-
<asp:ListView ID="msg_list" runat="server">
<ItemTemplate>
<table>
<tr class="myitem">
<td>
<asp:TemplateField HeaderText="Id" ItemStyle-HorizontalAlign="Left">
<ItemTemplate >
<asp:CheckBox ID="chkRow" onclick ="CheckSingleCheckbox(this)" AutoPostBack="true" runat="server" OnCheckedChanged="chkRow_CheckedChanged"/>
</ItemTemplate>
</asp:TemplateField>
<asp:Label role="menuitem" ID="msg_lbl" runat="server" text='<%#Eval("msg")%>' /><i style=" color:Gray; " > from
<asp:Label ID="tme" runat="server" Text='<%#Eval("name")%>' />
<i> on </i>
<asp:Label ID="tmelbl" runat="server" Text='<%#Eval("tme")%>'/>
<a id="msg-reply" class="btn button" data-toggle="modal" data-target="#msg-rply" style="cursor:pointer;" ><i class="glyphicon glyphicon-share-alt white"> </i></a> </td>
<hr style=" margin-top:1px; margin-bottom:1px; " />
</tr>
</table>
<%--<hr style=" margin-top:1px; margin-bottom:1px; " />--%>
you can use the script given below for finding which check box has been checked:-
<script type="text/javascript">
function CheckSingleCheckbox(ob) {
var grid = ob.parentNode.parentNode.parentNode;
var inputs = grid.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == "checkbox") {
if (ob.checked && inputs[i] != ob && inputs[i].checked) {
inputs[i].checked = false;
}
}
}
}
</script>

accessing checkbox inside listview?

i have a group of listviews with a checkbox in each listview as:
<telerik:RadListView Skin="Vista" ID="RadListView3" DataSourceID="SqlDataSource_subentry"
runat="server" ItemPlaceholderID="EmployeesContainer" DataKeyNames="ID">
<LayoutTemplate>
<fieldset id="FieldSet1">
<legend>Issues</legend>
<asp:PlaceHolder ID="EmployeesContainer" runat="server" ></asp:PlaceHolder>
<br />
<br />
</fieldset>
</LayoutTemplate>
<ItemTemplate>
<div style="width:200px; height:165px; -webkit-border-radius: 20px;-moz-border-radius: 20px; border-radius: 20px;
border:2px solid black; background-color:#00FFFF; text-align:center; margin-top:20px; margin-bottom:10px;
margin-left:20px; ">
<br />
<div style=" width:190px; height:auto; font-size:small;color:#000099; text-align:left; margin-left:12px;"><%#Eval("Worked_Project")%>
<label id="Label1" runat="server"><%# Eval( "ID" ) %></label>
<asp:CheckBox ID="MyCheckBox" runat="server" Text=<%# Eval( "ID" ) %>/></div>
<div style="width:190px; height:auto; font-size:small;color:black;text-align:center; padding-left:2px; margin-left:5px;" ><%# DataBinder.Eval(Container.DataItem, "Week_Ending", "{0:d/M/yyyy }")%></div>
<div style=" width:190px; height:75px; font-size:large; color:#000099; text-align:center; "><%#Eval("Activity")%> </div>
<div style=" width:190px; height:auto; font-size:small;color:black; text-align:left; margin-left:12px; margin-bottom:5px; "><%#Eval("UserId")%> </div>
</div>
</ItemTemplate>
on a button click i want to pick the id assocaiated with a particular checkbox as:
protected void Button1_Click(object sender, EventArgs e)
{
foreach (Control ctl in RadListView3.Controls)
{
CheckBox chk = (CheckBox)ctl.FindControl("MyCheckBox");
if (chk.Checked== true)
{
string value = chk.Text.ToString();
Session["id"] = value.ToString();
Label2.Text = Session["id"].ToString();
}
}
}
but it is giving error on line of code:
if (chk.Checked== true)
and the error is
Object reference not set to an instance of an object.
plzz help me out
Try this:
protected void RadListView1_ItemCommand(object sender,Telerik.Web.UI.RadListViewCommandEventArgs e)
{
CheckBox button = (CheckBox)e.ListViewItem.FindControl("CheckBox1");
if (e.CommandName == "Approve")
{
if (button.Checked == true)
{
//your code
}
else
{
//your code
}
}
}
or if you need to pick id on Button click only (loop) follow below link.
http://www.telerik.com/community/forums/aspnet-ajax/listview/get-selected-value-of-radlistview.aspx
You have to check type of this control first
CheckBox chk = ctl as CheckBox ;
if (chk !=null)
{
//do something
}
more info. about as
keyword

TabContainer using AjaxToolKit

Before I had a problem of findhing the control and setting the tab index. My problem now is that depending if there is data in some of the tabs they are set to Visible = true or false. If there is no data they are not visible (the tab that is) but the container and any of the other tabs that do have data are shown.
So when I do
$find('<%=myTabs.ClientID%>').set_activeTabIndex(1);
It gives me error because for that particular item there is no data in tab 0 so the tab I want to set now is at index 0 since the tab I want to set would move an index down. How can I know in which index this tab is at, using javascript?
Related code:
function getFocus() {
//need to be able to find out at which index pnlTab2 is at.. so i can set it
$find('<%=myTabs.ClientID%>').set_activeTabIndex(1);
document.getElementById('<%=pnlTab2.ClientID%>').focus();
return false;
}
<asp:UpdatePanel ID="UpdatePnl" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajaxToolKit:TabContainer runat="server" id="myTabs" CssClass="CustomTabStyle">
<ajaxToolKit:TabPanel ID="pnlTab1" runat="server" HeaderText="Tab 1">
<ContentTemplate>
<table>
<tr>
<td>
<div class="Tab1">
<asp:Label ID="lblPnl1" runat="server"></asp:Label>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajaxToolKit:TabPanel>
<ajaxToolKit:TabPanel ID="pnlTab2" runat="server" HeaderText="Tab2">
<ContentTemplate>
<table>
<tr>
<td>
<div class="Tab2">
<asp:Label ID="lblPnl2" runat="server"></asp:Label>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajaxToolKit:TabPanel>
</ajaxToolKit:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
SO basically, how can i find the index of a TabPanel so that I can set the activeTab to the index found?
=========================================================================
function setFocus() {
var success = false;
var tabInedx = 0;
var tabs = $find("<%= myTabs.ClientID %>").get_tabs();
for (; tabInedx < tabs.length; tabInedx++) {
if (tabs[tabInedx].get_id() == "<%= pnlTab2.ClientID %>") {
success = true;
break;
}
}
if (success) {
alert("Tab2 index: " + tabInedx)
}
}

Categories

Resources