Click here to Skip to main content
12,300,841 members (62,698 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: MVC3
HI Friends,

I am new to MVC 3.0
I want to load the partial view in the jquery dialog
i have done some code which is as follows
function showdate() {
          $('<div id="PT"></div>').appendTo('body')
          debugger;
          $('#PT').dialog({
              width: 550,
              height: 350,
              position: 'center',
              modal: true,
              title: "Data Entry Details",
              resizable: false,
              open: function (event, ui) {
 
                 $(this).load("@Url.Action("DataEntryPrintData")");
              }
          });
      }
My
$(this).load("@Url.Action("DataEntryPrintData")");
line is not loading the partial view

Am i going right Please help me to solve this issue

Thanks
Posted 16-Oct-12 2:02am
Edited 16-Oct-12 2:22am
v2
Comments
Zoltán Zörgő 16-Oct-12 8:55am
   
1) first try not to mix quotas. $(this).load('@Url.Action("DataEntryPrintData")');
2) how is your action declared, what attributes have you added?
3) are you sure, that the open event is triggered at the right point in time? have you tried create event?
deepakaitr12345 17-Oct-12 3:14am
   
Hi Zoltan

Thanks for the replay I have done this using the following code

function showdate() {
$('<div id="PT"></div>').appendTo('body')

$('#PT').dialog({
width: 800,
height: 350,
position: 'center',
modal: true,
title: "Data Entry Details",
resizable: false,
open: function (event, ui) {
var $url = '/Calculator/PrintData';
loaddata($url);
},
buttons:
{
close: function () {

$(this).dialog("close");
}
}
});
}
function loaddata(urldata) {
$('#PT').empty();
$('#PT').load(urldata);
$('#PT').dialog('open');

}

But my action result is not called always it is called single time my requirement is to called always when we clicked on button.

Please suggest any way

Thanks
Zoltán Zörgő 17-Oct-12 3:38am
   
Try this:

function showdate() {
$('<div id="PT"></div>')
.load( '/Calculator/PrintData')
.appendTo('body');

$('#PT').dialog({
width: 800,
height: 350,
position: 'center',
modal: true,
title: "Data Entry Details",
resizable: false,
open: function (event, ui) {
var $url = '/Calculator/PrintData';

},
buttons:
{
close: function ()
{
$(this).dialog("close");
}
}
}).open();
}

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 16 Oct 2012
Copyright © CodeProject, 1999-2016
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