だから私は、次のような方法は、ASP.NETは、分離コードでTRするCSSクラスを追加しようとし
protected void isDirector_CheckedChanged(object sender, EventArgs e)
{
HtmlTableRow row = (HtmlTableRow)e.Item.FindControl("today");
しかし、取得中にエラーが
CS0117持っている:「System.EventArgs」が「項目の定義が含まれていません。 「
EDIT:
<asp:UpdatePanel ID="UpdatePanel2"
runat="server"
UpdateMode="Conditional">
<ContentTemplate>
<asp:RadioButtonList ID="isDirector" RepeatDirection="Horizontal" runat="server" AutoPostBack="True" OnSelectedIndexChanged="isDirector_CheckedChanged">
<asp:ListItem Text="Yes" Value="True" selected></asp:ListItem>
<asp:ListItem Text="No" Value="False"></asp:ListItem>
</asp:RadioButtonList>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel
<ContentTemplate>
<tr runat="server" id="test">
<td>Director First Name:</td>
<td><asp:TextBox ID="DirectorfirstNametxt" runat="server" MaxLength="100" CssClass="input"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" Display="None" runat="server"
ErrorMessage="Director First Name is required." ControlToValidate="DirectorfirstNametxt"></asp:RequiredFieldValidator>
</td>
</tr>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="isDirector" EventName="SelectedIndexChanged" />
</Triggers>
TR ID = "test"のCSSクラスを変更しようとしています
これは、HTML-TableRow内のCheckBoxからのCheckedChanged-Eventハンドラと仮定します。送信者をCheckBoxにキャストしようとすると、HtmlTableRowのParentParent-Controlになります。 –
...だから、 'tr'の' runat = server'を作る必要があります。 –
CheckedChanged-EventハンドラのTRのCSSCLASSをCheckBoxからどのように変更できるのかまだ分かりません。 – StevieB