Their is no serverside onfocus event for asp textbox you can use textchanged event as follows.using update panel of ajax control you can avoid page refreshment.
<asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True" ontextchanged="TextBox1_TextChanged1" ></asp:TextBox>
protected void TextBox1_TextChanged2(object sender, EventArgs e)
{
}
On Client side onfocus event You can invoke a c# webmethord through ajax call as follows
HTML SOURCE
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#TextBox1").focus(function () {
$.ajax({
type: "POST",
url: "Default.aspx/test",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
}
});
});
});
</script>
C# code
[WebMethod]
public static void test()
{
}