Mytest

           <div class=”editor-field”>

@Html.TextBoxFor(m => m.DateOrdered, new { @class = “datepicker” })
@Html.ValidationMessageFor(model => model.DateOrdered)
</div>

<script type=”text/javascript”>
$(document).ready(
function () {
$(‘.datepicker’).datepicker({
changeMonth: true,
changeYear: true,
minDate: “-99Y”,
dateFormat: “dd/mm/yyyy”
});
});
</script>

 

 

 

<div id=”ajaxView”>

</div>
<script src=”@Url.Content(“~/Scripts/jquery-1.8.2.min.js”)” type=”text/javascript”></script>

<script type=”text/javascript”>
$(document).ready(function () {
var URL = ‘../OrderItemList/’+ @Model.Id;
$.getJSON(URL, function (data) {
var items = ‘<ul>’;
$.each(data, function (i, item) {
items += “<li>” + item.Quantity + ” – ” + item.Price + “</li>”
});
items = items + “</ul>”;
$(‘#ajaxView’).html(items);
});
});
</script>

 

 

 

 

[MetadataTypeAttribute(typeof(Order.OrderMetadata))]
public partial class Order
{
internal sealed class OrderMetadata
{
// Metadata classes are not meant to be instantiated.
private OrderMetadata()
{

}

[Required]
public Nullable<int> SupplierId { get; set; }

[DataType(DataType.Date)]
public Nullable<System.DateTime> DateOrdered { get; set; }
}

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *