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)110.7K
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 OriginalGriff 375
1 Afzaal Ahmad Zeeshan 125
2 Zoltán Zörgő 120
3 DamithSL 100
4 Peter Leow 95
0 enhzflep 40
1 Richard Deeming 25
2 OriginalGriff 10
3 Anddos 10
4 Kornfeld Eliyahu Peter 10


Advertise | Privacy | Mobile
Web03 | 2.8.150224.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