用了MasterPage继承了模板页以后,页面就没了<head></head><body></body>等等标记了,
我要调用一个用JS写的日历好象就不行了。
部分代码:(注意注释的地方)
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript" src="/scripts/Calendar.js"></script> //引用JS
<asp:TextBox id="txtDATE" runat="server"></asp:TextBox> //日历在这个框下显示,绑定该框
<INPUT TYPE="button" value='...' NAME='bntDATE' OnClick='showCalendar(txtDATE,0)'>//调用,老是提示txtDATE没定义
<table id="Table_HTML" style="width: 530px; height: 23px; background-image: url(../images/Slist.gif);">
<tr>
<td style="width: 596px">
<asp:Label ID="Label_StartDate" runat="server"></asp:Label>
<asp:TextBox id="TextBox_StartDate" runat="server"></asp:TextBox>
<asp:ImageButton ID="ImageButton_StartDate" runat="server" OnClientClick="aa()"/>
<asp:Label ID="Label_EndDate" runat="server"></asp:Label>
<asp:TextBox ID="TextBox_EndDate" runat="server"></asp:TextBox>
<asp:ImageButton ID="ImageButton_EndDate" runat="server"/>
<td>
<asp:ImageButton ID="ImageButton_Select" runat="server" OnClick="ImageButton_Select_Click" />
</td>
</tr>
</table>
... ...在没用MasterPage的地方没问题,为什么用了就不行了呢?请有经验的说说啊~~~
我要调用一个用JS写的日历好象就不行了。
部分代码:(注意注释的地方)
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript" src="/scripts/Calendar.js"></script> //引用JS
<asp:TextBox id="txtDATE" runat="server"></asp:TextBox> //日历在这个框下显示,绑定该框
<INPUT TYPE="button" value='...' NAME='bntDATE' OnClick='showCalendar(txtDATE,0)'>//调用,老是提示txtDATE没定义
<table id="Table_HTML" style="width: 530px; height: 23px; background-image: url(../images/Slist.gif);">
<tr>
<td style="width: 596px">
<asp:Label ID="Label_StartDate" runat="server"></asp:Label>
<asp:TextBox id="TextBox_StartDate" runat="server"></asp:TextBox>
<asp:ImageButton ID="ImageButton_StartDate" runat="server" OnClientClick="aa()"/>
<asp:Label ID="Label_EndDate" runat="server"></asp:Label>
<asp:TextBox ID="TextBox_EndDate" runat="server"></asp:TextBox>
<asp:ImageButton ID="ImageButton_EndDate" runat="server"/>
<td>
<asp:ImageButton ID="ImageButton_Select" runat="server" OnClick="ImageButton_Select_Click" />
</td>
</tr>
</table>
... ...在没用MasterPage的地方没问题,为什么用了就不行了呢?请有经验的说说啊~~~
用 <INPUT TYPE="button" value='...' NAME='bntDATE' OnClick='showCalendar(txtDATE,0)'>就可以了,这是在MasterPage中不知道为什么就不行。和服务器断控件是没关系的。