------------------------------------------In Default4.aspx------------------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="YourTextBox" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="open" OnClientClick="openPopup();" /></div>
</form>
</body>
<script type="text/javascript">
<!--
function openPopup()
{
var elementId = '<%= YourTextBox.ClientID %>';
var windowUrl = 'PopupPage.aspx?ElementId=' + elementId;
var windowId = 'NewWindow_' + new Date().getTime();
var windowFeatures =
'channelmode=no,directories=no,fullscreen=no,' +
'location=no,dependent=yes,menubar=no,resizable=no,scrollbars=yes,' +
'status=no,toolbar=no,titlebar=no,' +
'left=0,top=0,width=400px,height=200px';
var windowReference = window.open(windowUrl, windowId, windowFeatures);
windowReference.focus();
}
// -->
</script>
</html>
------------------------------------------------------------------------------------------------
------------------------------------------PopupPage.aspx----------------------------------
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" OnClientClick="closeWindow();" Text="Close" /></div>
</form>
</body>
<script type="text/javascript">
<!--
function closeWindow()
{
// C#
window.opener.document.getElementById('<%= Request["ElementId"] %>').value = 'Some new value';
window.opener.focus();
window.close();
}
// -->
</script>
</html>
-------------------------------------------------------------------------------------------------
Subscribe to:
Post Comments (Atom)
-
Remarks This property specifies the appearance of the embedded Windows Media Player. When uiMode is set to "none", "mini...
-
<body> <form id="form1" runat="server"> <img class="RibbonL" src="Imag...
-
Partial Class Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Lo...
What is the use of n-tier architecture and 3-tier architecture?
how to implement 3-tier architecture in asp.net using c#. 3-Tier architecture is also called layered architecture. Some people called it ...
No comments:
Post a Comment