add on page_init event of page
protected void Page_Init(object sender, EventArgs e)
{
linkTest.Attributes["onclick"] = "Show();";
Page.Form.Controls.Add(linkTest);
}
javascript method
<script type="text/javascript">
function Show() {
alert("Clicked");
}
</script>
Hope this will help you