在母版页中,我使用的是 ScriptManager,因此在内容页面中,根据下面的标记,我仅针对部分页面进行了回发。
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlProjectDocument" runat="server" Height="16px" AppendDataBoundItems="True"
Width="212px" onselectedindexchanged="ddlProjectDocument_SelectedIndexChanged"
AutoPostBack="True" onload="ddlProjectDocument_Load"
style="font-family: 'Courier New', Courier, monospace" >
<asp:ListItem Selected="True" Value="0">(select a value)</asp:ListItem>
</asp:DropDownList>
<br />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ddlProjectDocument" />
</Triggers>
</asp:UpdatePanel>
现在我已经在我的内容页面中添加了组合框,所以我删除了 ScriptManager 并将 ToolkitScriptManager 根据母版页的以下标记放置在母版页上,现在当我使用下拉列表控件回发时,整个页面会发生,而不仅仅是像以前那样,我是如何能解决这个问题吗?
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
.style1
{
width: 40%;
font-size:large;
}
</style>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<ajaxtoolkit:toolkitscriptmanager ID="ToolkitScriptManager1" runat="server">
</ajaxtoolkit:toolkitscriptmanager>
新内容页面的标记如下:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlProjectDocument" runat="server" Height="16px" AppendDataBoundItems="True"
Width="212px" onselectedindexchanged="ddlProjectDocument_SelectedIndexChanged"
AutoPostBack="True" onload="ddlProjectDocument_Load"
style="font-family: 'Courier New', Courier, monospace" >
<asp:ListItem Selected="True" Value="0">(select a value)</asp:ListItem>
</asp:DropDownList>
<br />
<ajaxtoolkit:ComboBox ID="ComboBox1" runat="server" onload="ComboBox1_Load"
AutoCompleteMode="Suggest"
style="font-family: 'Courier New', Courier, monospace" >
</ajaxtoolkit:ComboBox>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ddlProjectDocument" />
</Triggers>
</asp:UpdatePanel>