Hi
I have quite a complex (large) form for users to complete.
To speed up the process I have used AJAX updatepanels
But the postback is cuaseing the whole form to refresh not just the Div.
What am I doing wrong please
Here is an example - this also refreshes the whole page (but I want to update just the Div with the DDL)
Thanks
J
Example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><%@ Page Language="C#" %><script runat="server"> protected void EnDisMyBox(object sender, EventArgs e) { var ddl = (DropDownList)sender; var digit = ddl.ID.Replace("DDLMyDiv", string.Empty); var textBox = (TextBox)Page.FindControl("TxTMyDiv" + digit); textBox.Enabled = ddl.SelectedValue == "Enable text box"; }</script><html dir="ltr" xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><meta content="text/html; charset=utf-8" http-equiv="Content-Type" /><title>Test Page</title><style type="text/css"> input:enabled { background-color: #00FF00; } input:disabled { background-color: #FF0000; }</style></head><body><form id="Myform" runat="server"><asp:ScriptManager runat="server" id="ScriptManager1"></asp:ScriptManager><asp:UpdatePanel id="UpdatePanel_Div1" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional"><ContentTemplate> <div id="MyDiv1"><asp:DropDownList runat="server" id="DDLMyDiv1" AutoPostBack="true" OnSelectedIndexChanged="EnDisMyBox"><asp:listitem>Enable text box</asp:listitem><asp:listitem>Disable text box</asp:listitem><asp:listitem Selected="True">Select</asp:listitem></asp:DropDownList><asp:TextBox id="TxTMyDiv1" runat="server"></asp:TextBox></div></ContentTemplate></asp:UpdatePanel><asp:UpdatePanel id="UpdatePanel_Div2" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional"><ContentTemplate> <div id="MyDiv2"><asp:DropDownList runat="server" id="DDLMyDiv2" AutoPostBack="true" OnSelectedIndexChanged="EnDisMyBox"><asp:listitem>Enable text box</asp:listitem><asp:listitem>Disable text box</asp:listitem><asp:listitem Selected="True">Select</asp:listitem></asp:DropDownList><asp:TextBox id="TxTMyDiv2" runat="server"></asp:TextBox></div></ContentTemplate></asp:UpdatePanel><asp:UpdatePanel id="UpdatePanel_Div3" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional"><ContentTemplate> <div id="MyDiv3"><asp:DropDownList runat="server" id="DDLMyDiv3" AutoPostBack="true" OnSelectedIndexChanged="EnDisMyBox"><asp:listitem>Enable text box</asp:listitem><asp:listitem>Disable text box</asp:listitem><asp:listitem Selected="True">Select</asp:listitem></asp:DropDownList><asp:TextBox id="TxTMyDiv3" runat="server"></asp:TextBox></div></ContentTemplate></asp:UpdatePanel></form></body></html>