<a href="#" onclick="javascript:alert('hi');">Click</a>
if you use AJAX in your page you can call this code on required places
ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "test", "alert('welcome');");
on page load,
Page.ClientScript.RegisterStartupScript(typeof(Page), "MyScript", "alert('welcome');");