Try this solution:
in the aspx page, add a hidden field to store the state of button click
<asp:textbox runat="server" ID="TextBox1" ontextchanged="TextBox1_TextChanged" AutoPostBack="true"></asp:textbox>
<asp:HiddenField ID="HiddenField1" runat="server" Value="false" />
<asp:Button ID="Button1" runat="server" OnClientClick="setButtonClicked();" onclick="Button1_Click" Text="Button" />
in the header of aspx page, add the javascript:
<script>
function setButtonClicked() {
document.getElementById('<%= HiddenField1.ClientID %>').value = 'true';
}
</script>
on the code behind:
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
if (HiddenField1.Value == "false")
{
}
else
{
HiddenField1.Value = "false";
}
}