As mahen25 said you need to call in onclientclick event
<asp:Button ID="Button1" runat="server" onclientclick="message()" Text="Button"/>
You need to register the Onclick event in pageload if you want to call the function server side.
Button1.Attributes.Add("OnClick","message()");