简体   繁体   中英

GridView AutoPostBack

I have a textbox that is disabled when a dropdownlist is set to one value ( A ) and enabled when it's set to another ( B ). While in Edit Mode, if the textbox is disabled (dropdownlist value is A) and the value of the of the dropdownlist is changed to B , how can I get the textbox to become enabled?

ASP .NET code that disables textbox:

            <EditItemTemplate>
                <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("GRP") %>' MaxLength = "10" 
                    Enabled = '<%# !Eval("GRP_NM").ToString().Equals("A") %>' Height="19px" 
                    Width="70px" AutoPostBack="True"></asp:TextBox>
            </EditItemTemplate>

注册dropdownlist SelectedIndexChanged事件,并在处理程序中执行启用/禁用文本框。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM