Hi all,
I have my calling page as below :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WebApplication2.WebForm2" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<%----%>
<style type="text/css">
.ui-dialog {
position: fixed;
padding: .2em;
width: 300px;
overflow: hidden;
border: solid;
}
.ui-widget-overlay {
left: 0;
top: 0;
width: 100%;
height: 100%;
position: absolute;
background: #aaaaaa /*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x ;
opacity: .3;
filter: Alpha(Opacity=30) ;
}
</style>
<script type="text/javascript" src="Scripts/jquery-1.7.1.js"></script>
<script type="text/javascript" src="Scripts/jquery-ui-1.8.17.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('<div id="dialogDiv"></div>').load('WebForm1.aspx').appendTo('body');
$('#dialogDiv').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: true,
draggable: false,
title: "This new idiot dialog",
create: function () {
$(".ui-dialog-titlebar-close").hide();
},
buttons: {
"ok": function () {
$(this).dialog("close");
}
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
</form>
</body>
</html>
And my dynamically loaded page(webForm4.aspx in this case) as below :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebApplication2.WebForm4" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script language="javascript" type="text/javascript">
function bindEvent() {
var text = $('#inittext').val();
if (text.length < 3) {
alert("Enter atleast 3 characters");
}
else {
$('#dialogDiv').dialog('close');
}
}
</script>
</head>
<body>
<div id="content">
<table width="100%">
<tr>
<td align="center">Acknowledgement (Enter Initials):
<input id="inittext" type="text" value="" style="width: 40px;" maxlength="3" />
<input id="btnContinue" type="button" value="done" style="width: 40px;" onclick="bindEvent()" />
</td>
</tr>
</table>
</div>
</body>
</html>
I want to close the dialog box by clicking 'done' button which is generated in above code But the problem is the 'done' button click event is never fired. Can anyone please help me?
Also there is an html text box in webform4.aspx. How do I get the value of that text box in calling page?
P.S. -> I can change contents of webForm4.aspx hence it is necessary that dialog be closed by button on webForm4.aspx