0

I need to update an UpdatePanel on onkeyup event of textbox, I've writed this code:

<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="elenco.aspx.vb" Inherits="GestioneCommesse.WebForm1" EnableEventValidation = "false"%>

<asp:Content ID="BodyContent" ContentPlaceHolderID="Main" runat="server">
   <asp:CheckBox ID="chc_tutti_anni" runat="server" Text="Cerca in tutti gli anni" AutoPostBack="true" style="top: 151px; left: 10px; position: absolute; " />
   <asp:TextBox ID="txt_commessa" runat="server" onkeyup="javascript:__doPostBack('<%= UpdatePanel1.UniqueID %>','')" style="top: 90px; left: 250px; position: absolute; width: 199px"></asp:TextBox>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False">
        <ContentTemplate>

        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="chc_tutti_anni" EventName="CheckedChanged" />
        </Triggers>
</asp:UpdatePanel>

The problem is that the javascript:__doPostBack('<%= UpdatePanel1.UniqueID %>','') performs a full page postback, instead of postpack only the UpdatePanel.

On event CheckedChange everything is fine.

I've also tried this line:

<asp:TextBox ID="txt_commessa" runat="server" onkeyup="javascript:__doPostBack('<%= UpdatePanel1.UniqueID %>','')" autopostback="true" style="top: 90px; left: 250px; position: absolute; width: 199px"></asp:TextBox>

Someone could help me?

------EDIT------

I've just tried this solution, same problem How to trigger an UpdatePanel by a TextBox control?

------EDIT------

The question still unsolved, please help me.

Community
  • 1
  • 1
Pietro Z.
  • 521
  • 2
  • 6
  • 18

1 Answers1

0

Your textbox should be inside UpdatePanel->ContentTemplate.

JF Gagnon
  • 220
  • 3
  • 8