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