Load user control when dialog is opening.
Hi,
How it is possible to make all the input fields empty after closing
the dialog.
I am using the dialog to create a contact form. I wanted the dialog to
load a page and that's why in the div i placed user control and in the
user control there is an iframe. From the code behind I add src
attributes on the I frame. Everything works fine, except the part when
i am entereing some text and closing the window. After reopening i
still have the text. I tried to make postback on close, it works, but
i don't like the idea to make post back on close. Is there a way on
opening the dialog to load the control??? I think that that may help,
since i disabled view state on the Contact form.
On the page i have:
<a href="#" id="dialog_link">Contact me </a>
<div style="display: none" id="dialog">
<uc:ContactForm runat="server"></
uc:ContactForm>
</div>
$("#dialog_link").click(function() {
$("#dialog").dialog({ autoOpen: false,
resizable: false,
draggable: false,
width: 500,
position: top,
modal: true,
buttons: {
"Cancel": function() {
$("#Form :input").val("");//this doesn't work
$('form :input').val("");//i
$(this).dialog("close");
}
}
});
$("#dialog").dialog("open");
});