locked
Problem with ajax1.0 RRS feed

  • Question

  • User731351515 posted

    Hi all

    I have a problem with ajax.I placed one dropdownlist & one textbox in One updatepanel control.I make txtbox to invisible and if once dpdlist selected index changed then i make txtbox to visible=true.But it is not working.Any help plz.......?

    Thanks.

    Wednesday, September 19, 2007 5:12 AM

Answers

  • User222791821 posted

    Hi,

    Try this:

    <%@ Page Language="C#" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            TextBox1.Visible = true;
        }
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
                    <asp:ListItem>y</asp:ListItem>
                    <asp:ListItem>e</asp:ListItem>
                    <asp:ListItem>s</asp:ListItem>
                    </asp:DropDownList>
                    <asp:TextBox ID="TextBox1" runat="server" Visible="false">adsad</asp:TextBox>
                </ContentTemplate>
            </asp:UpdatePanel>
       
        </div>
        </form>
    </body>
    </html>

    Best Regards,

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 20, 2007 6:12 AM