在子页中的对象加载到母版页时会发生改变,比如子页中的对象TextBox1 到母版页中变成了ctl00$ContentPlaceHolder1$TextBox1。这个问题有点棘手。
子页中的代码
<td class="content_blue12" align="right" style="height: 8px; width:13%">テスト時間: </td>
<td style="height: 8px; width:34%">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </td>
<td class="content_blue12" align="right" style="height: 8px; width:13%">試験科目: </td>
<td style="height: 8px; width:25%">
<asp:DropDownList ID="DropDownList1" runat="server" Height="23px" Width="171px">
</asp:DropDownList></td>
<td align="right" style="height: 8px; width:15%">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="検索" Width="80px" /></td>
母版也中的代码
<td class="content_blue12" align="right" style="height: 8px; width:13%">テスト時間: </td>
<td style="height: 8px; width:34%">
<input name="ctl00$ContentPlaceHolder1$TextBox1" type="text" id="ctl00_ContentPlaceHolder1_TextBox1" onfocus="show_cele_date(ctl00$ContentPlaceHolder1$TextBox1,'','',ctl00$ContentPlaceHolder1$TextBox1)" /> </td>
<td class="content_blue12" align="right" style="height: 8px; width:13%">試験科目: </td>
<td style="height: 8px; width:25%">
<select name="ctl00$ContentPlaceHolder1$DropDownList1" id="ctl00_ContentPlaceHolder1_DropDownList1" style="height:23px;width:171px;">
</select></td>
<td align="right" style="height: 8px; width:15%">
<input type="submit" name="ctl00$ContentPlaceHolder1$Button1" value="検索" id="ctl00_ContentPlaceHolder1_Button1" style="width:80px;" /></td>