Skip to content

Instantly share code, notes, and snippets.

@rohitkandhal
Created July 7, 2013 17:22
Show Gist options
  • Save rohitkandhal/5944198 to your computer and use it in GitHub Desktop.
Save rohitkandhal/5944198 to your computer and use it in GitHub Desktop.
@model DialogTest.ViewModels.DeleteConfirmationViewModel
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Delete @Html.DisplayFor(x => x.HeaderText)</h3>
</div>
@using (Html.BeginForm(Model.PostDeleteAction, Model.PostDeleteController, FormMethod.Post, new { @class = "modal-form form-horizontal" }))
{
@Html.ValidationSummary()
<!-- Added hidden field so that these values persist when calling POST Action. Otherwise
POST action will have all these properties as null -->
@Html.HiddenFor( x => x.DeleteEntityId)
@Html.HiddenFor(x => x.PostDeleteAction)
@Html.HiddenFor(x => x.PostDeleteController)
@Html.HiddenFor(x => x.HeaderText) <!-- Though not required in post action but may be in case of error useful-->
<div class="modal-body">
<div class="row-fluid">
<div class="control-group">
Do you want to delete this entry?
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-danger" type="submit"><i class="icon-trash"></i> Delete</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment