Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: JQueryUI MVC3
Hi Friends,
 
I have been work around the dialog in mvc jquery.
The problem which i am facing that is
 
When i click the link dialog pop up,and i have a button in the dialog,
and i want to genrate the report on this button click.
 
I have done the following code for this.
 
public ActionResult ShowSummaryReport(string FromDate, string ToDate, string UserName)
        {
            testentity rexdb = new testentity ();
            List<AdminInfo> Countlist = new List<AdminInfo>();
            var listforUser=(from n in rexdb.test.AsEnumerable()
                            where n.LoginId == UserName
                            select n).ToList();
 
            ViewData["SummaryReport"] = listforUser;
            return View(listforUser);
        }

 function showDataInner() {
            $.ajax({
                url: '/LoginPage/ShowSummaryReport',
                type: 'POST',
                data: {
                 FromDate: $('#txtFromDateRe').val(),
                 ToDate: $('#txtToDateRe').val(),
                 UserName: $('#REGLoginid').val()
                 },
                success: function (data) {
                    $("#DivShowReport").empty();
                    $("#DivShowReport").html(data);
                     $('#DivShowReport').load(data);
                }
            });
        
        }
        $(document).ready(function () {
            $('#BtnInShowReport').click(function (e) {
                showDataInner();
            });
        });
 
$(function () {
          $('#dialog').dialog({
              autoOpen: false,
              width: 600,
              buttons: {
                  "Ok": function () { $(this).dialog("close"); },
                  "Cancel": function () { $(this).dialog("close"); }
              }
          });
          $('#datashoe').click(function (e) {
              $('#dialog').dialog('open');
              return false;
          });
      });
<div id="dialog" title="User data">
       <table>
           <tr>
               <td class="label1">
                   From Date(MM/DD/YYYY)
               </td>
               <td align="center">
                   <%: Html.TextBox("txtFromDateRe","",new { @class = "textboxcalc" })%>
               </td>
           </tr>
           <tr>
               <td class="label1">
                   To Date(MM/DD/YYYY)
               </td>
               <td align="center">
                   <%: Html.TextBox("txtToDateRe","",new { @class = "textboxcalc" })%>
               </td>
           </tr>
           <tr>
               <td class="label1" style="padding-top: 10px">
                   <input id="BtnInShowReport" type="submit" name="BtnInShowReport" value="" class="showReport" />
               </td>
           </tr>
           <tr>
               <td>
                   <div id="DivShowReport">
                       <table>
                           <tr>
                               <td>
                                   <%Html.RenderPartial("testview", ViewData["SummaryReport"]);%>
                               </td>
                           </tr>
                       </table>
                   </div>
               </td>
           </tr>
       </table>
   </div>
 

How to render the DivShowReport with data which i am picking from the action result ShowSummaryReport.and the pop up should be still open when click on the show report button.
 
Please help me
 
Thanks
Posted 5-Dec-12 1:15am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Replace the existing code with this. You need to pop up only the report when the button click $('#DivShowReport').dialog('open');
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 240
1 Kamal Rocks 184
2 PIEBALDconsult 150
3 BillWoodruff 148
4 Jochen Arndt 135
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 12 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100