Javascript is client side code and can thus not be executed in "code behind", unless of course you're ready to fire up a javascript interpreter in your "code behind". That should be avoided for all kinds of reasons, one of them being a performance issue.
What you can do though is to have the MD5 calculated when the document is loaded in the browser and then populate the field txtPasswordHash, which would of course defeat what you're trying to do, namely not sending the password in clear text.
Please use this in your code behind:
System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] data = System.Text.Encoding.ASCII.GetBytes(Value);
data = x.ComputeHash(data);
return System.Text.Encoding.ASCII.GetString(data);
Cheers,
Manfred