Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • this keyword in JQuery

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 32
    Comment on it

    We all know that the use of this keyword is that it  is used for the current reference of the control or anything from where the invocation is being made.

     

     

    So for making the proper use of this keyword we need to deal with the dynamic id of the control we are using in our project.

     

     

     

     

       @Html.ActionLink("Delete", "Delete", new { id = item.EmpId }, new { @class = "lnkDelete" })


     

     

    First we have made the id according to the values of the model called as the dynamic id generation.

     

     

     

      $(".lnkDelete").live("click", function (e) {
                // e.preventDefault(); use this or return false
                url = $(this).attr('href');
                $("#dialog-confirm").dialog('open');
    
                return false;
            });

     

     

    Then we will use it get the current id of the record to be deleted.

     

     

    <div id="dialog-confirm" style="display: none">
        <p>
            <span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
            Are you sure to delete?
        </p>
    </div>

     

     

    We will pass the id into the partial view and delete the detail of the employee.

    .net

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: