简体   繁体   中英

[ASP.Net/VB.Net]Retrieving info from a HTML input text block

I have 2 HTML blocks, with JQuery DateTimePicker. Now after the date is picked (When you click the input box, the datepicker appears, then you click the date, the date appears in the input box, and when you click away somewhere, the datepicker dissapears. Now I need to retrieve that info with VB.Net and ASP.Net. Thank you.


I just changed the HTML input box to Asp.net Textbox Then added the OnTextChanged function call when the text is changed, and called a function that stores that date into my class. As such:

Start date:
<asp:TextBox name="startDate" ID="startDate" OnTextChanged="startDate_TextChanged" runat="server" AutoPostBack="True"></asp:TextBox>

I tried to go with asp:TextBox before, but for some reason JQuery didn't work on it.

If you need to access the values of the input box on the client side, then you can use jquery as below:

         $("#Your_HTML_InputBox_ID").val();

On the server side, you can access the values from the FormCollection available on the page you post this form to.

Thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM