E
E. Kwong
I'm trying to make visible or invisible a textbox depending on whether a
checkbox is clicked. Both controls are inside the same gridview. I've
tried program this in the CheckedChanged event but visual studio keeps
telling me the textbox control is not declared. Here's how the controls are
in gridview:
<edititemtemplate>
<asp:CheckBox checked='<%#Eval("chkfield")%>'
ID="chk1" runat="server" TextAlign="Left" AutoPostBack="true"
OnCheckedChanged="chk1_CheckedChanged" />
<asp:TextBox id="txt1" Text='<%#Eval("textfield") %>'
Width="30" MaxLength="1" runat="server" />
</edititemtemplate>
What should be the correct way of doing this? Does this has to be done in
one of those row-level event of the gridview? Appreciate any advice.
checkbox is clicked. Both controls are inside the same gridview. I've
tried program this in the CheckedChanged event but visual studio keeps
telling me the textbox control is not declared. Here's how the controls are
in gridview:
<edititemtemplate>
<asp:CheckBox checked='<%#Eval("chkfield")%>'
ID="chk1" runat="server" TextAlign="Left" AutoPostBack="true"
OnCheckedChanged="chk1_CheckedChanged" />
<asp:TextBox id="txt1" Text='<%#Eval("textfield") %>'
Width="30" MaxLength="1" runat="server" />
</edititemtemplate>
What should be the correct way of doing this? Does this has to be done in
one of those row-level event of the gridview? Appreciate any advice.