Default.aspx
InBlock.gif<%@ Page Language= "C#" AutoEventWireup= "true" CodeBehind= "Default.aspx.cs" Inherits= "WebAppDialog._Default" %>
InBlock.gif
InBlock.gif<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
InBlock.gif<html xmlns="http://www.w3.org/1999/xhtml">
InBlock.gif<head runat="server">
InBlock.gif
InBlock.gif  <script type="text/javascript" language="javascript">
InBlock.gif    function pop() {
InBlock.gif      var arr = showModalDialog("pop.html", "", "dialogWidth:50em; dialogHeight:20em; status:0");
InBlock.gif      if (arr != null) {
InBlock.gif        javascript: document.forms[0]['TextBox1'].value = arr;
InBlock.gif      }
InBlock.gif    }
InBlock.gif  </script>
InBlock.gif
InBlock.gif  <title></title>
InBlock.gif</head>
InBlock.gif<body>
InBlock.gif  <form id="form1" runat="server">
InBlock.gif  <table>
InBlock.gif    <tr>
InBlock.gif      <td align="right">
InBlock.gif        Long-distance code:
InBlock.gif      </td>
InBlock.gif      <td align="center">
InBlock.gif        <asp:TextBox ID="TextBox1" runat="server" Enabled="False"></asp:TextBox>
InBlock.gif      </td>
InBlock.gif      <td align="left">
InBlock.gif        <input type="button" id="button1" value="Select City" οnclick="pop()" />
InBlock.gif      </td>
InBlock.gif    </tr>
InBlock.gif  </table>
InBlock.gif  </form>
InBlock.gif</body>
InBlock.gif</html>
 
pop.html:
InBlock.gif<head>
InBlock.gif
InBlock.gif  <script type= "text/javascript" language= "javascript">
InBlock.gif    function check(s) {
InBlock.gif      window.returnValue = s;
InBlock.gif      window.opener = null;
InBlock.gif      window.close();
InBlock.gif    }
InBlock.gif  </script>
InBlock.gif
InBlock.gif  <title>showmodaldialog_pop.html</title>
InBlock.gif</head>
InBlock.gif<body>
InBlock.gif  <table bgcolor= "#000000" border= "0" cellpadding= "1" cellspacing= "1" width= "400">
InBlock.gif    <tr>
InBlock.gif      <td align= "middle" bgcolor= "#ffcc33" height= "30" width= "15%">
InBlock.gif        <p>
InBlock.gif          City</p>
InBlock.gif      </td>
InBlock.gif      <td align= "middle" bgcolor= "#ffcc33" height= "30" width= "35%">
InBlock.gif        Code
InBlock.gif      </td>
InBlock.gif      <td align= "middle" bgcolor= "#ffcc33" height= "30" width= "15%">
InBlock.gif        City
InBlock.gif      </td>
InBlock.gif      <td align= "middle" bgcolor= "#ffcc33" height= "30" width= "35%">
InBlock.gif        Code
InBlock.gif      </td>
InBlock.gif    </tr>
InBlock.gif    <tr align= "middle" bgcolor= "#ffffff">
InBlock.gif      <td height= "30" width= "35%">
InBlock.gif        Bei Jing<a name= "beijing"></a>
InBlock.gif      </td>
InBlock.gif      <td height= "30" width= "15%">
InBlock.gif        <a href= "#" οnclick= "check('010')">010</a>
InBlock.gif      </td>
InBlock.gif      <td height= "30" width= "35%">
InBlock.gif        Shang Hai
InBlock.gif      </td>
InBlock.gif      <td height= "30" width= "15%">
InBlock.gif        <a href= "#" οnclick= "check('021')">021</a>
InBlock.gif      </td>
InBlock.gif    </tr>
InBlock.gif    <tr align= "middle" bgcolor= "#ffffff">
InBlock.gif      <td height= "30" width= "35%">
InBlock.gif        Tian Jin<a name= "tianjin"></a>
InBlock.gif      </td>
InBlock.gif      <td height= "30" width= "15%">
InBlock.gif        <a href= "#" οnclick= "check('022')">022</a>
InBlock.gif      </td>
InBlock.gif      <td height= "30" width= "35%">
InBlock.gif        Chong Qing
InBlock.gif      </td>
InBlock.gif      <td height= "30" width= "15%">
InBlock.gif        <a href= "#" οnclick= "check('023')">023</a>
InBlock.gif      </td>
InBlock.gif    </tr>
InBlock.gif  </table>
InBlock.gif</body>