Wanted to display data in asp:textbox using JavaScript. When I am using HTML textbox the value is displayed on the text box. But data is not displayed when using asp:Textbox.
function SearchDealer()
{
$.ajax(
{
async: false,
type: "POST",
url: "DealerDetails.aspx/GetDealerDetails",
data: "{DlrId:'" + dealerID + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data)
{
//This is a html text box so value is dsplayed.
document.getElementById('txt_sapcode').value = data.d.sapcode;
//No values displayed in this asp:textBox
document.getElementById('tex_dealername').value = data.d.DealerName;
document.getElementById('txt_addr1').value = data.d.Add1;
},
error: function ()
{
alert("Failed to update details.");
}
});
srchflg = true;
}