我有一個詳細視圖,其中會有對話,甚至是對話框中的評論框。我在部分視圖中有一個評論框。但在決定更新創建評論的對話時遇到了問題。 我知道我可以在部分視圖下面綁定代碼。但我很難調用它的操作方法。 因此,這將有詳細查看代碼,然後在下面的代碼在mvc刷新局部視圖
<div class="row">
<div class="panel-group" id="accordion">
@foreach (var convo in Model.TicketConversation.OrderByDescending(x => x.LastUpdatedTimestamp))
{
<div class="col-md-10 col-md-offset-1" style="padding-bottom: 5px;">
<div class="panel panel-default">
<div class="panel-heading removePaddingBottom" data-toggle="collapse" data-target="#[email protected]" style="background-color: inherit;" id="[email protected]" onclick="javascript:showHideLastConvoMsg(@convo.id)">
<a style="text-decoration: none !important; color: inherit; width: 100px;">
<span style="font-size: 16px; font-weight: bold; vertical-align: middle !important;"><i class="fa fa-chevron-right" id="[email protected]"></i> @convo.Subject</span>
</a>
@{ var lastmessage = convo.ConversationComments.First(); }
<div class="row">
<div id="[email protected]" style="margin-top: 15px;">
<div class="@lastmessage.DisplayCssClass">
<div class="row">
<div class="col-md-offset-1 col-md-10 removePadding" style="margin-bottom: 5px; margin-top: 10px;">
<strong>@lastmessage.TypeOfContact</strong>
</div>
<div class="col-md-offset-1 col-md-10 removePadding" style="margin-bottom: 10px;">
@lastmessage.Message
</div>
</div>
<div class="row">
<div class="col-md-offset-6 col-md-5 text-right text-muted" style="margin-bottom: 10px;">
<small>
<em>Posted by @lastmessage.CommenterName @@ @lastmessage.MessageTimestamp</em>
</small>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="[email protected]" class="panel-collapse collapse">
<div class="panel-body" style="padding: 0;">
@if (convo.IsReadOnly == false @*&& Model.IsClosed == false*@)
{
<div class="row">
@*<div class="col-md-12" style="padding-bottom: 3px; padding-top: 3px;">
<a href="@Url.Action("ReplyQuery", new { cid = convo.id })" class="pull-right btn btn-sm btn-default"><i class="fa fa-reply"></i> Reply</a>
</div>*@
---- here i'm calling partial view for comment box---
}
@foreach (var item in convo.ConversationComments)
{
<div>
<div class="message-border @item.DisplayCssClass">
<div class="row">
<div class="col-md-offset-1 col-md-10 removePadding" style="margin-bottom: 5px;">
<strong>@item.TypeOfContact</strong>
</div>
<div class="col-md-offset-1 col-md-10 removePadding" style="margin-bottom: 10px;">
@item.Message
</div>
</div>
<div class="row">
<div class="col-md-5 text-right text-muted">
<small>
<em>Posted by @item.CommenterName @@ @item.MessageTimestamp</em>
</small>
</div>
</div>
</div>
</div>
}
</div>
</div>
</div>
</div>
}
</div>
</div>
該方法可以被調用來獲得會話列表?我需要寫一個新的操作方法嗎?