This is a migrated thread and some comments may be shown as answers.

[Solved] RadTextBox Data Persist Issue

1 Answer 107 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Meghna
Top achievements
Rank 1
Meghna asked on 26 May 2009, 06:51 AM
In my code I have used RadTextBox for Search functionality. I have a textbox in which if I type any name, and click on search button next to it, the RadGrid below will get populated with the search result. But with this implementation I found few bugs in it:

When I click on any other button or refresh a page, the textbox still persist the name type into it.

I want to clear this textbox on refreshing a page and while invoking any other event of the page except search button click. I have done
RadTextBox.Text = ""; on every other event but it is not working.
Can any one help me in this?

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 26 May 2009, 07:16 AM
Hello Meghna,

Probably you are seeing the described issue in Firefox, which is caused by browser behavior (you can check it with a regular asp:TextBox to compare).

A possible solution is to clear the textbox value client-side:

<telerik:RadTextBox ID="RadTextBox1" runat="server">
    <ClientEvents OnLoad="RadTextBox1_OnLoad" />
</telerik:RadTextBox>

<script type="text/javascript">

function RadTextBox1_OnLoad(sender, args)
{
    window.setTimeout(function(){
        sender.set_value("");
        }, 1);
}

</script>


Sincerely yours,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
Meghna
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or