[RESOLVED][1.0/1.1] Can anyone help me stop the blink?
The following code I have included here is C# that's written into .ASP, what it does is that every time I change the text within Report ID textbox (TextBoxRptid), it will go and make sure that the Table Name textbox (TextBoxTn) will be changed as well. But, there's a problem: Every time I change the value in TextBoxRptid, the page is reloaded which creates a short blink of the screen. And it's really annoying, so does anyone know of any other ways to write the following code to remove the reload of the page or blink?
Code:
private void TextBoxRptid_TextChanged(object sender, System.EventArgs e)
{
// Tablename = Report ID
TextBoxTn.Text=TextBoxRptid.Text;
}
PS: I know I can create another button and do the function when I click it, but I need something else. Since the users may not always remember to click the button before adding data.
Re: [1.0/1.1] Can anyone help me stop the blink?
You are doing it at server side, that is why it is refreshing after every keypress. You need to do it at client side, using Javascript.
Code:
//Your text boxes
<asp:TextBox id="TextBoxRptid" runat="server" onkeyup="changeTN()" />
<br/>
<asp:TextBox id="TextBoxTn" runat="server" />
//JS Code
<script type="text/javascript">
function changeTN()
{
document.getElementById('TextBoxTn').value = document.getElementById('TextBoxRptid').value;
}
</script>
Re: [RESOLVED][1.0/1.1] Can anyone help me stop the blink?
forgot to mention I had AutoPostBack on, but regardless, only having the user load the script on its computer (client side), it will cause this problem :(
thanks for the heads up.