私はMVCを始めたばかりで、jquery-mobileとのmvcの相互作用のためのサンプルの概念実証ページを作成しようとしています。私はこれについての答えを探しましたが、適切なクエリを作成するのに十分な知識がまだないと思います。
私の見解では、私はこのように機能する出力を生成しようとしています(jqmデモサイトからサンプリング):
<ul data-role="listview" data-inset="true">
<li><a href="index.html">
<h3>Stephen Weber</h3>
<p><strong>You've been invited to a meeting at Filament Group in Boston, MA</strong></p>
<p>Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.</p>
<p class="ui-li-aside"><strong>6:24</strong>PM</p>
</a></li>
<li><a href="index.html">
<h3>jQuery Team</h3>
<p><strong>Boston Conference Planning</strong></p>
<p>In preparation for the upcoming conference in Boston, we need to start gathering a list of sponsors and speakers.</p>
<p class="ui-li-aside"><strong>9:18</strong>AM</p>
</a></li>
</ul>
だから、私はそれをこのように働いています:
@foreach (var item in Model) {
<li>
@Html.ActionLink( LargeExpandedMultiContentText, "Edit", new { id = item.SysID })
</li>
}
簡単な質問方法がわからない私の質問は、MVC用語で、ActionLink()によって生成されたhrefがjqmWebサイトからサンプリングしたスタイルと一致するように変数をどのように入力するかです。
私はこれを試しましたが、ほとんど機能しますが、特に「スティーブン・ウェーバー」やその他の文字列をアイテム/モデルから引き出す場所に到達したときは、「正しい」方法ではないと確信しています...さらにテキストをエンコードしますが、それを簡単に処理する方法があると確信しています。
@foreach (var item in Model) {
<li>
@{ String txt = "<h3>Stephen Weber</h3><p><strong>You've been invited to a meeting at Filament Group in Boston, MA</strong></p><p>Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.</p> <p class=\"ui-li-aside\"><strong>6:24</strong>PM</p>";
}
@Html.ActionLink( txt, "Edit", new { id = item.SysID })
</li>
}
ありがとう、私はあなたの助けに感謝します
ブライアン