Click here to Skip to main content
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 3:02am
Edited 16-Oct-12 3:22am
(no name)105.8K
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 575
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,466
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,897


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 16 Oct 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