I am trying to use some AJAX and ASP.Net together to allow me to run functions without having to refresh the whole page, but I ran into a problem with this
Here is my code
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:DropDownList ID="ddl1" runat="server" OnSelectedIndexChanged="update1" /> <asp:TextBox runat="server" ID="txt1" /> </ContentTemplate> </asp:UpdatePanel>
And here is my code for
Sub update1(ByVal sender As Object, ByVal e As EventArgs) txt1.Text = Now.ToString End Sub
The event does not fire because I do not have AutoPostBack="True" on my ddl, but adding that ddl will return the whole page.
Is there a way to avoid using AutoPostBack="True" so that it only refreshes the panel?
I know I can use asp:Button to get around this, but I really would like to be able to use ddl with OnSelectedIndexChanged
thanks
Jamie taylor
source share