ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Populate TextBoxes on Button Click using Web API in ASP.Net<p>Hi&nbsp;<a class="username" rel="irshad1231">irshad1231,</a></p> <p>Refer below modified code and change&nbsp;according to the field you want to display.</p> <pre class="brush: js">&lt;script&gt; $(document).ready(function () { $(&#34;#GetData&#34;).click(function () { var Id = $(&#34;#Text1&#34;).val(); $(&#34;#tblPopulation&#34;).show(); $.ajax({ url: &#39;http://localhost:53027/api/Demo&#39;, dataType: &#34;json&#34;, type: &#34;POST&#34;, contentType: &#39;application/json; charset=utf-8&#39;, data: &#39;{ Pat_MRnumber:&#34;&#39; + Id + &#39;&#34;}&#39;, success: function (data) { $(&#39;#tblPopulation&#39;).find(&#39;#Text2&#39;).val(data.d[0].Pat_MR); $(&#39;#tblPopulation&#39;).find(&#39;#Text3&#39;).val(data.d[0].MedicalRecordID); $(&#39;#tblPopulation&#39;).find(&#39;#Text4&#39;).val(data.d[0].PatientID); $(&#39;#tblPopulation&#39;).find(&#39;#Text5&#39;).val(data.d[0].IsCitizen); }, error: function (xhr) { alert(&#39;No Valid Data&#39;); } }); }); }); &lt;/script&gt;</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/766458/Populate-TextBoxes-on-Button-Click-using-Web-API-in-ASPNet/https://www.aspforums.net:443/Threads/766458/Populate-TextBoxes-on-Button-Click-using-Web-API-in-ASPNet/Mon, 24 Dec 2018 03:16:39 GMT