<%@ Page language="c#" Codebehind="getdate.aspx.cs" AutoEventWireup="false" Inherits="net1.getdate" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>getdate</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script language=javascript>
function getdate(obj)
{
window.showModalDialog("returndate.aspx",obj,"dialogWidth:350px;dialogHeight:275px;help:no;center:yes;resizable:no;status:no");
}
</script>
</HEAD>
<body>

<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<asp:TextBox id="TextBox1" runat="server" ReadOnly=true onclick="getdate(this)"></asp:TextBox></FONT>
</form>
</body>
</HTML>

解决方案 »

  1.   

    <%@ Page language="c#" Codebehind="returndate.aspx.cs" AutoEventWireup="false" Inherits="net1.returndate" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>returndate</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    <script language="javascript">
    function returndate()
    {
    var tempObj=window.dialogArguments;         
        tempObj.value=window.document.all.text1.value;
        window.returnValue =window.document.all.SelectText.value;          
    window.close(); 
    }
    </script>
    </HEAD>
    <body>
    <form id="Form1" method="post" runat="server">
    <FONT face="宋体">
    <asp:Calendar id="Calendar1" runat="server"></asp:Calendar><INPUT type="button" value="Button" onclick="window.close();"></FONT>
    <asp:TextBox ID="text1" Runat="server" style="DISPLAY:none"></asp:TextBox>
    <asp:Button id="Button1" runat="server" Text="Buttond"></asp:Button>
    </form>
    </body>
    </HTML>
      

  2.   

    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;namespace net1
    {
    /// <summary>
    /// returndate 的摘要说明。
    /// </summary>
    public class returndate : System.Web.UI.Page
    {
    protected System.Web.UI.WebControls.TextBox text1;
    protected System.Web.UI.WebControls.Button Button1;
    protected System.Web.UI.WebControls.Calendar Calendar1;

    private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
    } #region Web 窗体设计器生成的代码
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.Calendar1.SelectionChanged += new System.EventHandler(this.Calendar1_SelectionChanged);
    this.Button1.Click += new System.EventHandler(this.Button1_Click);
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion private void Calendar1_SelectionChanged(object sender, System.EventArgs e)
    {
    string date= Calendar1.SelectedDate.ToShortDateString();
    text1.Text=date;
    } private void Button1_Click(object sender, System.EventArgs e)
    {
    Page.RegisterStartupScript("js1","<script>returndate();</script>");
    }
    }
    }
      

  3.   

    总题是,
    运行后,用window.showModalDialog("returndate.aspx",obj,"dialogWidth:350px;dialogHeight:275px;help:no;center:yes;resizable:no;status:no");
    打开了对话框,选择日期时,
    他会怎么打开一个窗口,
    新窗口的地址是
    javascript:__doPostBack('Calendar1','1732')
    请问各位大哥,大姐,这是什么原因

      

  4.   

    1. in returndate.aspx, add a base tag: </HEAD>
    <base target="_self">
    <body>2. change the script in returndate.aspx:<script language="javascript">
    function returndate()
    {
    var tempObj=window.dialogArguments;         
        tempObj.value=window.document.all.text1.value;
        window.returnValue =tempObj.value;//window.document.all.SelectText.value;          
    window.close(); 
    }
    </script>
      

  5.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=49ML4AO8-5PB3-4KNY-NJZD-LJOIOXV4M1X4
      

  6.   

    window.returnvalue是输错了的,
    与他无关
      

  7.   

    我用C# 
    vb 的我不想看
      

  8.   

    你的问题,在你的returndate.aspx页面中加一句<base target="_self">就解决了,起码在IE6中如此,否则的话,你需要用FRAMESET