Create a second page which displays just the
GridView
with the data you want to display. Pass the parameter in the querystring.
You then have two options to display it in a jQuery UI dialog. You can either create an
<iframe>
pointing to the second page, and display that in the dialog:
var url = 'DisplayGrid.aspx?param=' + encodeURIComponent(bin);
var frame = $('<iframe/>').css('border', '0').attr({
'src': url,
'width': '100%',
'height': '100%'
});
$('#modalbinDets')
.empty().append(frame)
.dialog(...
Or you can use jQuery's
.load()[
^] method to load the content of the second page directly into your dialog:
var url = 'DisplayGrid.aspx?param=' + encodeURIComponent(bin);
$('#modalbinDets')
.load(url + ' body > *')
.dialog(...
The
' body > *'
on the end of the URL specifies the elements from the loaded document that you want to insert into the matched element. If you only want to insert a specific part of the page, you can wrap it in an element with a known ID and update this selector to point to that element.
NB: If your grid view includes things like paging, editing, or anything else that causes a postback, you'll need to use the
<iframe>
option.