Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 960
  • Last Modified:

Text Changed Event

Does Text changed event work on ASP Pages. I want the event to be trigerred after i type in a character in a textbox. I have set the autopostback to true on the textbox but the event is only trigerred after i click on another control which will submit the form. I even tried registering the event at startup in javascript like tboContent.Attribute.Add("OnChange","return TxtChange();") but still diint work.
 protected void tboContent_TextChanged(object sender, EventArgs e)
    {
        if (tboCharacters.Text.Length <= 160)
        {
            tboCharacters.Text = Convert.ToString(160 - Convert.ToInt64(tboContent.Text.Length - 1));
        }
    }
0
Dawie de Villiers
Asked:
Dawie de Villiers
  • 2
3 Solutions
 
kerwinsiyCommented:
tboContent.Attribute.Add("OnBlur","return TxtChange();")
0
 
Dawie de VilliersAuthor Commented:
Hie, Thank you for your response but i didnt work, its just working the same as onchange, i will have to send a postback using other controls.

Thank you
0
 
prairiedogCommented:
Text Changed event fires with a full postback when the TextBox control looses its focus, in another word, when the cursor moves away from the TextBox to another control such as using Tab or clicking a button, etc.
0
 
Dawie de VilliersAuthor Commented:
Thank you very much guys,
I finally figured out how to solve this, the "onkeyup event" doesnt need a postback and its updating the other textbox perfectly without a postback.

Thnak you very much
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now