Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

How Do I retrieve the Control's ID?

$
0
0

Hi,

I have a table, containing inline code that creates a set of contains.

This is the code:

<asp:UpdatePanel runat="server" ID="calendarBarreir"><ContentTemplate><table><tr><td><-</td><td class="auto-style2"><table><% for (int i = 0; i < 5; i++)
                       {%><tr><%
                     for (int j = 0; j < 7; j++)
                     {
                     %><td><%if (DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month) - ((i * 7) + j + 1) > -1)
                           { %><div style="margin: 10px; font-family: 'Adobe Gothic Std B'; font-size: medium; background-color: #FFE8D9; border: thick solid #2F774E; height: 139px; width: 153px;"><div style="margin-left: 75%; margin-top: 5%; font-size: x-large; color: #00CC99;"><%=i*7+j+1%></div><asp:ListBox ID="Listbox1" runat="server" Style="margin-left: 9px; margin-right: 0px; margin-top: 2px" Width="139px" Height="73px" ToolTip="<%#(i*7+j+1) %>"></asp:ListBox><asp:DropDownList ID="DropDownList" runat="server" Height="18px" Style="margin-left: 12px" Width="130px"></asp:DropDownList></div></td><%}
                       }
                     %></tr><%  } %></table></td><td class="auto-style1">-></td></tr></table></ContentTemplate></asp:UpdatePanel>

This code creates a set of containers, in a table shape, rows of 5by 7. each container contains a listbox, and a dropdown list. 

What I want is when e listbox event is fired, I want the code behind to figure out which square the listbox belongs to, so if the listbox is in the 3rd square, I want an integer of 3 transferred to the event handler. So How do I do this? 

I can't use ids because there is no way to add inline code to the id property

I can't use datakeys because this is not a gridview

Anyone know?




Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>