0
は私がmvcページでDateTime.ascx(Nerdinner Editor Templates)を設定する方法は?
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime>" %>
<%= Html.TextBox("", String.Format("{0:yyyy-MM-dd HH:mm}",Model)) %>
<script type="text/javascript">
$(function() {
$('#EventDate').datetime({
userLang: 'en',
americanMode: true
});
});
</script>
\共有\ EditorTemplates \ DateTimeのDatetime.ascx
\ビューを追加し、私は私のDateFromでそれを使用する必要がある - Texboxへ。
<%@ Register src="../Shared/EditorTemplates/DateTime.ascx" tagname="DateTime" tagprefix="uc1" %>
<p>
Please enter your Date Range Below.
</p>
<p>
Please enter your Date Range Below.
</p>
<form method="post" action="<%= Html.AttributeEncode(Url.Action("List")) %>">
<div>
<table cellpadding="2" cellspacing="0" class="vertical">
<tr>
<th>Date From:</th>
<td><%= Html.TextBox("datefrom") %></td>
</tr>
<tr>
<th>Date To:</th>
<td><%= Html.TextBox("dateto")%></td>
</tr>
<tr>
<th></th>
<td><input type="submit" value="Show My Orders" /></td>
</tr>
</table>
</div>
</form>
私はNerdinner
からDatetime.ascxを得たあなたはところで代わりHtml.TextBox
のHtml.EditorFor
を使用する必要がよろしく
ユーザーコントロールの代わりにHTMLヘルパーを使用してみましたかhttp://を参照してくださいwww.asp.net/mvc/tutorials/creating-custom-html-helpers-cs – Daveo
リンクゴンゴンの正解に加えて、JavaScriptはあなたが意図したことをするつもりですか? –
NerdinnerからDatetime.ascxを取得しました – Crimsonland