I found this with google (google is free - you can use it too).
In your aspx file:
<asp:textbox onblur="javascript:msgBox('test');"/>
In your aspx.cs file:
protected void Page_Load(Object sender, System.EventArgs a)
{
TextBox1.Attributes.Add("onblur", "javascript:msgbox('Test');");
}