Wednesday, September 26, 2007

TextBox TextChanged client side

The TextChanged event of a TextBox fires when doing a postback in ASP.NET. So when you type something in the textbox, it won't fire before you change the focus or do something else that causes a postback to the server.

To solve this, I found a piece of code that adds a Javascript to the HTML control's OnKeyUp event. This Javascript causes a PostBack, so that your event fires each time you type something in your textbox.

Code:

string js = "javascript:" + ClientScript.GetPostBackEventReference(TextBox1, "@@@@@buttonPostBack") + ";" ;
TextBox1.Attributes.Add("onkeyup", js);

Tuesday, September 11, 2007

Windows Live Writer

Even Windows Live Writer uittesten om op mijn blog berichten te zetten... 't ziet er allemaal wel chique uit :-)

 

EDIT: howla, het werkt nog ook, netjes ;-)