See
You are using both client and server side method
For this You have to call client side in client event and server side in server event
For this I have showing modifited code in following below
<div>
<asp:HiddenField ID="hdnResultValue" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" OnClientClick="getvalue();"/>
</div>
Server button click event should for test purpose is that
protected void Button1_Click(object sender, EventArgs e)
{
string codeBehindValue = hdnResultValue.Value;
Response.Write(codeBehindValue);
}