This action has nothing to do with ASP.NET. Perhaps the simplest way would be this:
<html>
<head>
<title>Do something on load</title>
</head>
<body>
<script>
document.body.onload = function() {
DoSomethingHere();
}
</script>
</body>
</html>
Remaining problem is the function you show in your question. I have no idea why would you do such weird thing and how can you use a hard-coded constant 160. But it's apparent that to call it on load, you cannot use "this"; you should, again, take the DOM element related to your text box by
ID
and pass it instead of "this".
—SA