Good day, I have a .aspx page where, inside an asp: UpdatePanel, there is an asp: TextBox to which I assigned an event onblur, in the following way:
.aspx:
<asp:UpdatePanel ID="updatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="txt1" runat="server"></TextBox>
<asp:Button ID="btn1OnBlur" runat="server" Visible="false" OnClick="btn1OnBlur_Click"></asp:Button>
</ContentTemplate>
</asp:UpdatePanel>
.aspx.cs:
protected void Page_Load(object sender, EventArgs e) {
//Asignar evento onblur
txt1.Attributes.Add("onblur",Page.ClientScript.GetPostBackEventReference(btn1,""));
}
protected void btn1OnBlur_Click(object sender,EventArgs e){
if(txt1.Text.Equals("")){
LlenarControles(); //...
}
}
The event works fine, but the problem is that it reloads the entire page, and not just the UpdatePanel . If I have another function with another control and the same event is triggered, reload the page once again and delete the changes that the previous event had made ...