TextBox1.Attributes.Add("onFocus", "JavaScript:this.select();");
for additional
On page load event
TextBox1.Attributes.Add("onfocus", "javascript:return Highlight('" + TextBox1.ClientID + "');");
TextBox1.Attributes.Add("onblur", "javascript:return DeHighlight('" + TextBox1.ClientID + "');");
<script type="text/javascript" language="javascript">
function Highlight(control)
{
var mycontrol = document.getElementById(control);
mycontrol.className = 'Welcome';
}
function DeHighlight(control)
{
var mycontrol = document.getElementById(control);
mycontrol.className = 'Bye';
}