How to open a user control as popup using jQuery dialog
I have Parts.aspx page,
UserControl1.ascx,[ it contains a textbox and one button1 ] Add.ascx Controls [ it contains a textbox, button2, button 3 ] I have added UserControl1.ascx in parts.aspx page.Now when I click button1 [usercontrol1.ascx] it should open like a popup Add.ascx on top of the page using JQuery Dialog.
In Add.ascx user enters comments in the textbox and clicks Submit, after this it开发者_JAVA技巧 should close Add.ascx and the comments entered in Add.ascx page should appear in UserControl1.ascx textbox for readonly.You can create a new page (that is never navigated to, except via the popup), make a jQuery ajax call to retrieve this page, and push the html result into the content of the dialog.
Create a new aspx page, add user control there.
use the script below @ head of the page
<script>
function ShowPopup()
{
var answer = window.showModalDialog("mypage.aspx","","dialogWidth:500px;dialogHeight:300px;Center:yes");
}
</script>
On the button or label click
<asp:Control ... onClientClick="ShowPopup();"/>
精彩评论