だから私はこのforeachループを持っています...
@foreach (Attachment attachment in Model)
{
<tr class="row@(index%2 == 0 ? "" : " even")">
<td>
@Html.ActionLink(attachment.AttachedFilename, "ViewAttachment", "Auction", new {docID = attachment.AttachmentId}, new {target = "_blank"})
</td>
<td>
<a id="@attachment.AttachmentId" class="publishAttachment" name="public" style="float: right" tabindex="7">
<img src="@Url.Content("~/Content/Images/cross_circle.png")" />
</a>
</td>
</tr>
index++;
}
そして、私はこのjqueryを持っています...
$(document).ready(function () {
$('.publishAttachment').click().confirmationDialog({ message: "Are you sure you want to cancel ?", okButton: "I am sure", cancelButton: "No, I don't want to do this",
onSuccess: function () {
var obj = $(this).attr('id');
alert(obj);
return false;
}
});
});
したがって、基本的にリンクをクリックすると、ポップアップ ダイアログが表示され、メッセージと [はい] または [いいえ] ボタンが表示されます。ただし、ID をドキュメントに渡す準備ができていないと、タスクを完了できません。リンク内のオンクリックであれば簡単に実行できますが、使用しているウィジェットでは機能しないため、クリックされた要素の ID を取得するにはどうすればよいですか。
ありがとう
ベン