Please visit DEMANDDRAFT.SHOP for quality of products...

Ad

Search This Blog

Thursday, June 25, 2015

How to open popup window when we click on Image button in Web Grid in MVC4

Please find the Web Grid Code :-


  @grid.GetHtml(tableStyle: "webgrid-table",
                        headerStyle: "webgrid",
                        footerStyle: "webgrid-footer",
                        alternatingRowStyle: "webgrid-alternating-row",
                        rowStyle: "webgrid-row-style",
                    columns:
                grid.Columns
                (

grid.Column(format: @<a onclick="Approval(@item.CId);" > <img id="imgHApprove" src="~/images/Approve.png" width="15px;" height="15px;" style="cursor:pointer;" title="click here to approve by" disabled="disabled" /></a>)
 )
                  )

To open a Popup window, Please find the Code below.

<script language="Javascript" type="text/javascript">
    function Approval(CId) {
       window.open('/HUser/Approve' + '?CId=' + CId, "WindowPopup", 'width=600px,height=450px,top=150,left=50');
    }
    </script>

No comments:

Post a Comment