You can't use '<%= txtLat.ClientID %>' in javascript. This is asp mark up.
document.getElementById('<%= txtLat.ClientID %>').value = marker.position.lat()
document.getElementById('<%= txtLng.ClientID %>').value = marker.position.lng();
Change function codeAddress()
function codeAddress()
to
function codeAddress(txtAddressClientId,txtLatClientId,txtLngClientId)
Replace javascript lines
var address = window.document.getElementById('<%= txtAddress.ClientID %>').value;
document.getElementById('<%= txtLat.ClientID %>').value = marker.position.lat()
document.getElementById('<%= txtLng.ClientID %>').value = marker.position.lng();
With
var address = window.document.getElementById(txtAddressClientId).value;
document.getElementById(txtLatClientId).value = marker.position.lat()
document.getElementById(txtLngClientId).value = marker.position.lng();
Remove the onClientClick event. This will be set in the code behind.
<asp:button id="btnBuscar" runat="server" text="Buscar" cssclass="btn" onclick="btnBuscar_Click" xmlns:asp="#unknown" />
In the code being set the onClientClick method.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
btnBuscar.OnClientClick = "return codeAddress('" & txtAddress.ClientID & "','" & txtLat.ClientID & "','" & txtLng.ClientID & "')"
End Sub