Tuesday, October 7, 2014

Confirmation Box with Gridview Rows

function ConfirmationUpdate() 
{
    var totalRows = $('TABLE[id*=gvPerson] tr').length; //If Record = 2
    if (totalRows > 0) {
            return confirm('It Overwrite the Person update. Do you want to continue?');
    }
}

<asp:Button ID="btnSave" runat="server" Text="Save" OnClientClick="return ConfirmationUpdate()" OnClick="btnSave_Click" />

Grid Use this
OnClientClick="return confirm('Confirm to remove');"




OnClientClick='<%# Item.IsAlive ? "return confirm(\"OFF\");"  : "return confirm(\"ON\");" %>'
 OnClientClick='<%# Eval("ProviderName", "return confirm(\"Delete the datasource {0}?\");") %>'


Others Condition

if ($('INPUT[id*=hfChangeInactive]').val() == "Inactive

No comments:

Post a Comment