Janet
Janet

Reputation: 61

cannot clear textbox wtihin update panel

I'm pretty new to update panels and would appreciate some help. I have a form with a few textboxes and submit button. Before the update panel, I would do a page validation on the button click event and if everything was okay, enter the date into a db and then clear two of the textboxes. Then I added the update panel. Now, the textboxes won't clear. Everything else is working great. Any help?

    <asp:UpdatePanel ID="upForm" runat="server" ChildrenAsTriggers="false" 
        UpdateMode="Conditional">
    <Triggers><asp:AsyncPostBackTrigger ControlID="ddlMember"  
        EventName="SelectedIndexChanged" /></Triggers></asp:UpdatePanel>

CType(upForm.FindControl("txtAuth"), TextBox).Text = String.Empty  
txtAuth.Text = String.Empty

Upvotes: 0

Views: 2755

Answers (1)

Bala R
Bala R

Reputation: 108957

Try calling upForm.Update() after setting the textbox's Text to String.Empty

Upvotes: 1

Related Questions