Hi, My codes are as below in as mvc view.
<input type="button" name="btnOpen" id="btnOpen" value="Open Dialog" /> <%= Html.Infragistics() .Dialog() .ContentID("divDialog") .State(DialogState.Closed) .Modal(true) .Height("740px") .Width("1040px") .CloseOnEscape(true) .Resizable(false) .Draggable(false) .Render() %>
<div id="divJobs"> <script> alert('test'); </script> </div>
When page is load it fires two times.
Is that bug? Does anyone have idea about this?
Thanx
Dharmendra
Finally I ended up to not to go with igDialog instead I used jquery dialogbox.
I found that jquery dialogbox is having same issue but there is a solution. On button click I have removed the script tag by finding it from dialogbox before opening it and everything works well.
$("#btnOpen").click(function () {
$("#DivPickInstr").find("script").remove(); //Did the trick hope this help some one :) $("#DivPickInstr").dialog({ model: true, height: 650, width: 950, resizable: false, });
});
Thank you,Dharmendra Mistry
Got it!
so I got rid of the .appendTo on the jquery frame creation and just replaced it with a staright igDialog with the references to the elements as you had given in the example. no more double post! you guys might want to update your documentation for this control.
var containerdata = document.body;var mainElem = $('<div />').appendTo(containerdata);var pagePath = '<%=Page.ResolveClientUrl("~/")%>AssetTeam/AddTeamMember/' + selectedAssetTeam;
$('<iframe id="' + frameId + '" src="' + pagePath + '">').igDialog({ height: 600, width: 1000, headerText: "Search for Users To Add", footerText: pagePath, modal: true, showFooter: true, mainElement: mainElem, container: containerdata});
thanks, the on close event that was causing it to fire the page again seems to have been alleviated,
however I'm still getting double posts when opening the window. I'll try to move it around and see where it needs to sit, but thanks for the close issue... clicking continue on the js errors was getting to be annoying.
Hi gmbart01,
The igDialog does not trigger those postback events intentionally. You may experiment with prebuilding final layout of dialog manually and passing layout elements explicitly into options.var container = document.body;//or reference to formvar mainElem = $('<div />').appendTo(container);var iframe = $('<iframe id="myIframe" src="..." />').appendTo(mainElem);iframe.igDialog({ mainElement: mainElem, container: container, .... });
I think this is related to this thread. I have a link that I click that generates a new iframe appends it to the body but it fires the page twice.
If in the igDialog definition I add the temporaryURL, it causes it to call the server 4 times! lol
Also when the window is closed, everything works great, but it appears to call the Server AGAIN for the modal window that I had opened, which based on your explanation above makes sense that it fired it again because it is apparently changing the parents target. but how do I stop it, or put the control where it needs to belong to stop the multiple calls...
function openNewDialogWindow(frameId, pagePath, frameHeight, frameWidth) {
$.ig.loader(function () {
var framecontainer = "#" + frameId;
if ($(framecontainer).length > 0) {$(framecontainer).igDialog("open");}
else {
$('<iframe id="' + frameId + '" src="' + pagePath + '">').appendTo('body');
$(framecontainer).hide();
$(framecontainer).igDialog({
height: frameHeight,
width: frameWidth,
headerText: "Risk Acknowledgement Form",
footerText: pagePath,
modal: true,
showFooter: true
$(framecontainer).on({igdialogstatechanged: function (e, args) {
if (args.action == "close") {
$(framecontainer).off();
$(framecontainer).igDialog("destroy");
$(framecontainer).remove();
$("#AcknowledgementsLead").igGrid("dataBind");
}