Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi I have a web grid that contains CRUD operation and wanna to open this operation in modal dialog : my details column is like this :

@foreach (var items in Model)
{
    @grid.GetHtml(columns: new[]{grid.Column("Name",header:""),
    grid.Column("",header:"",format:(item)=> Html.ActionLink("More Details", "Details", "Category", new{
    categoryId = items.Id,
    @class = "DetailsDialog",
    data_dialog_id = "Dialog",
    data_dialog_title = "Details"
    },null))
}

and also my script :
JavaScript
<script type="text/javascript">

    $.ajaxSetup({ cache: false });

    $(document).ready(function () {
        $(".DetailsDialog").live("click", function (e) {
            e.preventDefault();

            $("<div></div>")
        .addClass("dialog")
        .attr("id", $(this)
        .attr("data-dialog-id"))
        .appendTo("body")
        .dialog({
            title: $(this).attr("data-dialog-title"),
            close: function () { $(this).remove(); },
            modal: true,
            height: 400,
            width: 800,
            left: 0
        })
    .load(this.href);
        });

        $(".close").live("click", function (e) {
            e.preventDefault();
            $(this).closest(".dialog").dialog("close");
        });
    });
</script>




but when I want to send categoryId to my this action link :

C#
public ActionResult Details(Guid categoryId)
        {
            var categoryDetails = _categoryRepository.GetCategoryById(categoryId);
            return PartialView("Details", categoryDetails);
        }

it doesn't render in PopUp ! how can I solve this ??
thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900