0

I am passing some parameters from my view to read it to my controller and its already working properly.

Question: Is it possible to call my view as pop-up window rather than load it on the same page?

Currently I am using this call from my index:

 @Html.ActionLink(
 "Update",
 "OpDiffSelected",
 new { getOP = @item.op, getOp_desc = @item.op_desc, getDoc_id = item.doc_id, getTitle = item.title, getOp_dif = item.op_dif }
                       )

Controller:

public ActionResult OpDiffSelected(String getOP, String getOp_desc, String getDoc_id, String getTitle, int getOp_dif)
        {
            storeSelectedOP_Diff obj = new storeSelectedOP_Diff
            {
                op = getOP,
                op_desc = getOp_desc,
                doc_id = getDoc_id,
                title = getTitle,
                op_dif = getOp_dif
            };

            return View(obj);
        }

And here is my view which loads on the same page:

@model userInfo.Models.storeSelectedOP_Diff

<div>
    <h4>Update OP</h4>
    <hr />
    <dl class="dl-horizontal">
        <dt>
            OP
        </dt>

        <dd>
            @Html.DisplayFor(model => model.op)
        </dd>

        <dt>
            OP Desc
        </dt>

        <dd>
            @Html.DisplayFor(model => model.op_desc)
        </dd>

    </dl>
</div>
<p>    
    @Html.ActionLink("Back to List", "OpDiffIndex")
</p>

Any suggestion or comments to transfer it as pop-up. TIA

jazb
  • 5,498
  • 6
  • 37
  • 44
Syntax Rommel
  • 932
  • 2
  • 16
  • 40
  • 1
    are you using boot-strap? : https://getbootstrap.com/docs/4.0/components/modal – jazb Oct 26 '18 at 02:37
  • Use ajax to call the server method, and then load the returned partial view into a modal in the success callback –  Oct 26 '18 at 02:42
  • could you give some initial sample or idea how can I inject that to my code? – Syntax Rommel Oct 26 '18 at 06:26
  • Take a look for these examples: https://stackoverflow.com/questions/11336834/mvc-passing-parameters-from-view-to-popup, https://stackoverflow.com/questions/21113950/use-actionlink-to-open-modal-and-pass-parameter-in-mvc and https://stackoverflow.com/questions/32714917/asp-mvc-passing-value-into-modal-window. – Tetsuya Yamamoto Oct 26 '18 at 07:41

0 Answers0