Results 1 to 3 of 3

Thread: [RESOLVED][1.0/1.1] Can anyone help me stop the blink?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Location
    New York
    Posts
    8

    [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.
    Last edited by MetaEdgeDanny; Jun 26th, 2007 at 04:14 AM.

  2. #2
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    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>
    Show Appreciation. Rate Posts.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Location
    New York
    Posts
    8

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width