Click here to Skip to main content
11,720,374 members (80,131 online)
Rate this: bad
good
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
(no name)115.6K
v2
Comments
Zoltán Zörgő at 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 at 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ő at 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
0 Sergey Alexandrovich Kryukov 2,029
1 OriginalGriff 844
2 F-ES Sitecore 640
3 Maciej Los 609
4 Richard MacCutchan 540


Advertise | Privacy | Mobile
Web01 | 2.8.150901.1 | Last Updated 16 Oct 2012
Copyright © CodeProject, 1999-2015
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