Click here to Skip to main content
16,005,241 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying To Show Details And Edit Mode In JQUI Dialog For Grid() But Its Not Working Properly .Some Times Edit Popup Is Work For once Then on Next Edit It opens in New Tab(Window) and when i click on Edit Then Detail Popup Doesn't Appear.



HTML
 @Html.ActionLink("Edit", "EditDetails", "Admin", new { CompanyID = @item.Company_Id }, new { @class = "edit_link" })

  @Html.ActionLink("Detail", "CompanyDetails", "Admin", new { CompanyID = @item.Company_Id }, new { @class = "details-modal" })

 <div id="my-dialog" title="Company Details">

</div>
<div id="edit-dialog" title="Edit Details">

</div>
    <script type="text/javascript">
        $(document).ready(function () {
       $('#my-dialog').dialog({
           autoOpen: false,
           width: 600,
           height: 600,
           resizable: false,
           modal: true


       });
       $('#edit-dialog').dialog({
           autoOpen: false,
           width: 600,
           height: 600,
           resizable: false,
           modal: true


       });
       $(".edit_link").click(function (e) {
           //e.preventDefault();
           $('#edit-dialog').load($(this).attr('href'),function (){

           $('#edit-dialog').dialog('open');
            });


         e.preventDefault();

       });


       $('.details-modal').click(function (e) {
           var theURL = $(this).attr('href');

           $('#my-dialog').load(theURL, function () {
               $(this).dialog('open');

         //      e.preventDefault();
           });


         e.preventDefault();
       });

    });

</script>
Posted
Comments
SDK03 2-Sep-13 13:24pm    
Why you are using Html.ActionLink? It will redirect the page and your jquery 'edit_link' will never work.

You can used $.Get or Ajax.ActionLink. Ajax.ActionLink have AjaxOption which you can use here.

 
Share this answer
 
Comments
vivektiwari97701 3-Sep-13 1:02am    
Thanks For Suggestion .But I have sold myself..
There Was Problem In JavaScript I found that when i Debug My JS code in IE8..


Thanks For All Replies
 
Share this answer
 

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