在IE6.0下能正常显示,在IE7.0下显示效果如下:(第一次论坛发帖,不晓得怎么把图片帖上来,描述一下吧:日历的下半部分被截去了,对话框下边和右边都有空白)
原代码如下:
Calendar.aspx
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Calendar</title>
</head>
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" onload="init()">
<form id="form1" runat="server">
<iframe frameborder="no" id="cal" runat="server" marginheight="0" marginwidth="0" scrolling="no" width="100%" height="100%">
</iframe>
</form>
</body>
<script type="text/javascript" language="javascript">
function init()
{
document.getElementById("cal").src = "CalendarForm.aspx?oldDate=" + location.search.match(new RegExp("[\?\&]"+"oldDate"+"=([^\&]*)(\&?)","i"))[1] ;
}
</script>
</html>
CalendarForm.aspx
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>CalendarForm</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Calendar ID="CalendarForm" runat="server" BackColor="#FFFFCC" BorderColor="#FFCC66"
BorderWidth="1px" DayNameFormat="Full" Font-Names="Verdana" Font-Size="
Height="200px" ShowGridLines="True" Width="200px" OnSelectionChanged="CalendarForm_SelectionChanged" OnLoad="CalendarForm_Load">
<SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
<SelectorStyle BackColor="#FFCC66" />
<OtherMonthDayStyle ForeColor="#CC9966" />
<NextPrevStyle Font-Size="
<DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
<TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="
<TodayDayStyle BackColor="#FFC0FF" />
</asp:Calendar>
</div>
</form>
</body>
</html>
测试页代码:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript">
function showCal()
{
window.showModalDialog('CheckAndAccept/Calendar.aspx?oldDate=
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type=button value="show" onclick="showCal()" />
</div>
</form>
</body>
</html>
现在修改Calendar.aspx页面中红色字体内容替换为style="height:200px; width:200px;",这样修改后,日历控件可以正常显示了,但是模式对话框的右半部分总是有空白。调整了好半天也没有弄好。请高手帮忙看看这个问题,如果有知道原因的,也请告知。谢谢大家了。