I use ASP.NET and have a label control on my page, which I fill with the jQuery-Command
$('#<%= myLabel.ClientID %>').html(content);
.val() does not seem to work with this.
Somehow, I have Problems getting the content in code-behind. In the code, the myLabel.Text-Property is still empty.
$(document). ready(function() { $("input[type=checkbox]:checked"). click(function () { var values = $("input label"). map(function () { return $(this).
var label = $("<label>"). attr('for', "from"); label. html('Date: ' + '<input type="text" id="from name="from" value="">'); $(function() { $("#from"). datepicker(); });
If you want to display the value on the client and have it available on the page, you need an input that'll get sent to the code-behind when you POST like this:
$('#<%= myLabel.ClientID %>').html(content); $('#<%= myInput.ClientID %>').val(content); <asp:Label Id="myLabel" runat="server" /> <asp:HiddenField ID="myInput" runat="server" />
In the code-behind:
myInput.Value
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With