For Javascript, you just need the Alert function as Sunasara Imdadhusen said.
For the code behind, it is a little more complex. As long as the button has a
runat="server"
attribute, and you have connected up the event handler via
OnClick="butLogin_Click"
then this should work:
protected void butLogin_Click(object sender, EventArgs e)
{
Response.Write("<script>alert('Your Message')</script>");
}