I'm creating a textbox in the code behind:
TextBox txt = new TextBox();
txt.ID = "txtRef" + count + dr["DataField"].ToString();
div.Controls.Add(txt);
And I'm trying to set the value for this textbox in a jquery function but nothing I have tried so far is updating the textbox.
Using document.getElementById('txtRef1j.3rdPartRef').value = 'test'; returns the error Cannot set property 'value' of null.
I also tried $('#txtRef1j.3rdPartRef').val('test') and $('[id$="txtRef1j.3rdPartRef"]').value = 'test'; but the textbox doesn't update.
txtRef1j.3rdPartRef. If I check the console for the ID itsid="ctl00_ContentPlaceHolder1_txtRef1j.3rdPartRef". I have also tried using this ID but it still won't update the textbox