Retrieve value from asp:textbox with JQuery

后端 未结 6 1537
闹比i
闹比i 2020-12-06 16:29

I have a few asp:textbox controls in a form on a webpage, below is a snippet. The first is a field where the recipient is entered, the other is a larger textarea where the r

6条回答
  •  感动是毒
    2020-12-06 17:12

    IN ASP.NET, you will need to write in this way:

    var recipient = $("#<%=recipient.ClientID%>").val();

    In MVC, then you can write in this way:

    var recipient = $("#recipient").val();

提交回复
热议问题