⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dialog.aspx

📁 Telerik是很大的第三方软件制造商
💻 ASPX
字号:
<%@ Page language="c#" AutoEventWireup="false" Codebehind="Dialog.aspx.cs" Inherits="Telerik.WindowExamplesCS.Dialog.DefaultCS" %>
<html>
	<head runat="server">
		<title>Dialog</title>		
		<style>
		
		*
		{
			font: normal 11px Arial, Verdana, Sans-serif;		
		}
				
		.bButton
		{
			width: 100px;
			height: 20px;
			border: 1px;
			background-image: url(../bBtuttonBg.gif);
			background-repeat: no-repeat;
			background-color: #fff;			
			color: #666666;
			vertical-align: middle;
		}				
		</style>
	</head>
	<body onload="ConfigureDialog()">
		<form id="Form1" method="post" runat="server">
		<script type="text/javascript">
			//This code is used to provide a reference to the radwindow "wrapper"
			function GetRadWindow()
			{
				var oWindow = null;
				if (window.radWindow) oWindow = window.radWindow;
				else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
				return oWindow;
			}		
			
			function ConfigureDialog()
			{
				//Get a reference to the radWindow wrapper
				var oWindow = GetRadWindow();
				
				//Obtain the argument 
				var oArg = oWindow.Argument;
				
				//Use the argument
				var oArea = document.getElementById("DialogInfoArea");
				oArea.value = oArg.TextValue;
				oArea.style.color = oArg.Color;
				oArea.style.backgroundColor = oArg.BackColor;					
			}
						
			function OK_Clicked()
			{
				var oWindow = GetRadWindow();
				
				//Get current content of text area
				var oNewText = document.getElementById("DialogInfoArea").value;
				alert ("Text to be returned to main page: " + oNewText);
				
				//Variant1: Passing the argument to the Close method will result in the same behavior
				oWindow.Close(oNewText);
				
				//Variant2: Invoke the calback function, pass it the result as an argument
				//oWindow.CallBack(oNewText);
										
				//Variant3: Possible to set the Argument property of RadWindow here, and read it in the OnClientClose event handler!
				//oWindow.Argument = oNewText;			
			}
			
			function Cancel_Clicked()
			{
				var oWindow = GetRadWindow();			
				oWindow.Close();
			}				
		</script>	
  
		Text from main page (possible to change):
		<br/><textarea id="DialogInfoArea" rows="5" cols="38"></textarea>
		<br/>		
		<button onclick="OK_Clicked(); return false;" class="bButton">OK</button> &nbsp;&nbsp;		
		<button onclick="Cancel_Clicked(); return false;" class="bButton">Cancel</button>	
		</form>
	</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -