提示的错误信息为:
“/HFAWeb”应用程序中的服务器错误。
--------------------------------------------------------------------------------A control with ID 'btn_Search_Blur' could not be found for the trigger in UpdatePanel 'up_Style_Sheet'.
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.InvalidOperationException: A control with ID 'btn_Search_Blur' could not be found for the trigger in UpdatePanel 'up_Style_Sheet'.源错误: 执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 堆栈跟踪:
[InvalidOperationException: A control with ID 'btn_Search_Blur' could not be found for the trigger in UpdatePanel 'up_Style_Sheet'.]
System.Web.UI.UpdatePanelControlTrigger.FindTargetControl(Boolean searchNamingContainers) +310
System.Web.UI.AsyncPostBackTrigger.Initialize() +28
System.Web.UI.UpdatePanelTriggerCollection.Initialize() +76
System.Web.UI.UpdatePanel.Initialize() +41
System.Web.UI.UpdatePanel.OnLoad(EventArgs e) +52
System.Web.UI.Control.LoadRecursive() +52
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2184
我猜可能是因为我的'btn_Search_Blur' 是在ajaxToolKit:TabContainer中, 所以找不到, 大家帮看看该怎么解决?<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="style_v3_Default"
Theme="default" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolKit" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="wdbdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>HFA Inventory System Version 1.0</title>
<link type="text/css" rel="stylesheet" href="../../lib/css.css" />
</head>
<body style="margin: 0px;">
<form id="form1" runat="server">
<asp:ScriptManager ID="scriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Path="../../lib/common.js" />
<asp:ScriptReference Path="../../lib/calendar_Net.js" />
</Scripts>
</asp:ScriptManager>
<div class="verdana12ptbo" style="background-color: #BBBBBB; color: #FFFFFF;">
Style Sheet Management</div>
<table id="tab_Menu" cellpadding="2" cellspacing="1" style="width: 201px; border: 0px;
vertical-align: top; padding-bottom: 3px;">
<tr>
<td class="menu12ptwhbo" style="background-color: #9EB1DB; white-space: nowrap; width: 50%;"
onmouseover="this.style.cursor='hand';chgBg(this,'#FFBC6E')" onmouseout="chgBg(this,'#9EB1DB')"
onclick="window.open('style_edit.aspx', 'Create', 'width=800, height=580, scrollbars=yes, resizable=yes, menubar=no');">
Create Style
</td>
<td class="menu12ptwhbo" style="background-color: #9EB1DB; white-space: nowrap; width: 50%;"
onmouseover="this.style.cursor='hand';chgBg(this,'#FFBC6E')" onmouseout="chgBg(this,'#9EB1DB')"
onclick="window.location.reload();">
Reload
</td>
</tr>
</table>
<ajaxToolKit:TabContainer ID="tabContainer1" runat="server" Width="100%">
<ajaxToolKit:TabPanel ID="tabPanel1" runat="server" HeaderText="Blur Search">
<ContentTemplate>
<table style="height: 100%; background-color: #FFFFFF;" width="100%" border="0" cellspacing="1"
cellpadding="2" id="searchmenu">
<tr>
<td class="verdana12pt" style="width: 15%;" align="right">
<span id="label8">Search</span> :</td>
<td class="verdana12pt" style="width: 15%;">
<asp:TextBox ID="tb_Search" runat="server" CssClass="verdana12pt" Width="100%"></asp:TextBox></td>
<td class="verdana12pt" style="width: 65%;">
</td>
</tr>
<tr>
<td colspan="3" align="center" class="verdana12pt">
<asp:Button ID="btn_Search_Blur" runat="server" Text="Search" CssClass="verdan12pt"
Width="200" OnClick="btn_Search_Click" />
<input type="reset" value="Clear" class="verdana12pt" style="width: 200px" /></td>
</tr>
</table>
</ContentTemplate>
</ajaxToolKit:TabPanel>
<ajaxToolKit:TabPanel ID="tabPanel2" runat="server" HeaderText="Condation Search">
<ContentTemplate>
<table width="100%" border="0" cellspacing="1" cellpadding="2" style="background-color: #FFFFFF;
height: 100%;">
<tr>
<td colspan="6" align="center" class="verdana12pt">
<asp:Button ID="btn_Search_Condition" runat="server" Text="Search" CssClass="verdan12pt"
Width="200" OnClick="btn_Search_Click" />
<input type="reset" value="Clear" class="verdana12pt" style="width: 200px" /></td>
</tr>
</table>
</ContentTemplate>
</ajaxToolKit:TabPanel>
</ajaxToolKit:TabContainer>
<asp:UpdatePanel ID="up_Style_Sheet" runat="server" UpdateMode="conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btn_Search_Blur" />
</Triggers>
<ContentTemplate>
<span class="verdana12pt">
<asp:LinkButton ID="lbtn_First" runat="server" Text="|< 首页" CommandArgument="First"
OnCommand="MovePage"></asp:LinkButton>
<asp:LinkButton ID="lbtn_Pre" runat="server" Text="<上一页" CommandArgument="Pre"
OnCommand="MovePage"></asp:LinkButton>
<asp:LinkButton ID="lbtn_Next" runat="server" Text="下一页>" CommandArgument="Next"
OnCommand="MovePage"></asp:LinkButton>
<asp:LinkButton ID="lbtn_Last" runat="server" Text="尾页>|" CommandArgument="Last"
OnCommand="MovePage"></asp:LinkButton><br />
共 <asp:Label ID="lbl_Sum_Count" runat="Server" Text="10" ForeColor="red"></asp:Label> 页中的第 <asp:Label
ID="lbl_Current_Index" runat="Server" Text="1" ForeColor="red"></asp:Label> 页 <asp:TextBox
ID="tb_pageIndex" runat="server" Width="50px"></asp:TextBox> <asp:LinkButton
ID="lbtn_Go" runat="server" Text="到页数" CommandArgument="Go" OnCommand="MovePage"></asp:LinkButton>
</span>
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
<tr bgcolor="#EFEFEF">
<th style="white-space: nowrap;" class="verdana12pt" onmouseover="this.style.cursor='hand';chgBg(this,'#CDCDCD')"
onmouseout="chgBg(this,'#EFEFEF')">
Style Number</th>
</tr>
<asp:Repeater ID="rep_Style_sheet" runat="server">
<AlternatingItemTemplate>
<tr class="verdana12pt" style="background-color: #EFEFEF;" onmouseover="this.style.cursor='hand'; c = this.style.backgroundColor; this.style.backgroundColor = '#666666'"
onmouseout="this.style.backgroundColor = c">
<td align="left" valign="top">
<%# Eval("Style_Code") %>
</td>
</tr>
</AlternatingItemTemplate>
<ItemTemplate>
<tr class="verdana12pt" style="background-color: White;" onmouseover="this.style.cursor='hand'; c = this.style.backgroundColor; this.style.backgroundColor = '#666666'"
onmouseout="this.style.backgroundColor = c">
<td align="left" valign="top">
<%# Eval("Style_Code") %>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
“/HFAWeb”应用程序中的服务器错误。
--------------------------------------------------------------------------------A control with ID 'btn_Search_Blur' could not be found for the trigger in UpdatePanel 'up_Style_Sheet'.
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.InvalidOperationException: A control with ID 'btn_Search_Blur' could not be found for the trigger in UpdatePanel 'up_Style_Sheet'.源错误: 执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 堆栈跟踪:
[InvalidOperationException: A control with ID 'btn_Search_Blur' could not be found for the trigger in UpdatePanel 'up_Style_Sheet'.]
System.Web.UI.UpdatePanelControlTrigger.FindTargetControl(Boolean searchNamingContainers) +310
System.Web.UI.AsyncPostBackTrigger.Initialize() +28
System.Web.UI.UpdatePanelTriggerCollection.Initialize() +76
System.Web.UI.UpdatePanel.Initialize() +41
System.Web.UI.UpdatePanel.OnLoad(EventArgs e) +52
System.Web.UI.Control.LoadRecursive() +52
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2184
我猜可能是因为我的'btn_Search_Blur' 是在ajaxToolKit:TabContainer中, 所以找不到, 大家帮看看该怎么解决?<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="style_v3_Default"
Theme="default" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolKit" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="wdbdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>HFA Inventory System Version 1.0</title>
<link type="text/css" rel="stylesheet" href="../../lib/css.css" />
</head>
<body style="margin: 0px;">
<form id="form1" runat="server">
<asp:ScriptManager ID="scriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Path="../../lib/common.js" />
<asp:ScriptReference Path="../../lib/calendar_Net.js" />
</Scripts>
</asp:ScriptManager>
<div class="verdana12ptbo" style="background-color: #BBBBBB; color: #FFFFFF;">
Style Sheet Management</div>
<table id="tab_Menu" cellpadding="2" cellspacing="1" style="width: 201px; border: 0px;
vertical-align: top; padding-bottom: 3px;">
<tr>
<td class="menu12ptwhbo" style="background-color: #9EB1DB; white-space: nowrap; width: 50%;"
onmouseover="this.style.cursor='hand';chgBg(this,'#FFBC6E')" onmouseout="chgBg(this,'#9EB1DB')"
onclick="window.open('style_edit.aspx', 'Create', 'width=800, height=580, scrollbars=yes, resizable=yes, menubar=no');">
Create Style
</td>
<td class="menu12ptwhbo" style="background-color: #9EB1DB; white-space: nowrap; width: 50%;"
onmouseover="this.style.cursor='hand';chgBg(this,'#FFBC6E')" onmouseout="chgBg(this,'#9EB1DB')"
onclick="window.location.reload();">
Reload
</td>
</tr>
</table>
<ajaxToolKit:TabContainer ID="tabContainer1" runat="server" Width="100%">
<ajaxToolKit:TabPanel ID="tabPanel1" runat="server" HeaderText="Blur Search">
<ContentTemplate>
<table style="height: 100%; background-color: #FFFFFF;" width="100%" border="0" cellspacing="1"
cellpadding="2" id="searchmenu">
<tr>
<td class="verdana12pt" style="width: 15%;" align="right">
<span id="label8">Search</span> :</td>
<td class="verdana12pt" style="width: 15%;">
<asp:TextBox ID="tb_Search" runat="server" CssClass="verdana12pt" Width="100%"></asp:TextBox></td>
<td class="verdana12pt" style="width: 65%;">
</td>
</tr>
<tr>
<td colspan="3" align="center" class="verdana12pt">
<asp:Button ID="btn_Search_Blur" runat="server" Text="Search" CssClass="verdan12pt"
Width="200" OnClick="btn_Search_Click" />
<input type="reset" value="Clear" class="verdana12pt" style="width: 200px" /></td>
</tr>
</table>
</ContentTemplate>
</ajaxToolKit:TabPanel>
<ajaxToolKit:TabPanel ID="tabPanel2" runat="server" HeaderText="Condation Search">
<ContentTemplate>
<table width="100%" border="0" cellspacing="1" cellpadding="2" style="background-color: #FFFFFF;
height: 100%;">
<tr>
<td colspan="6" align="center" class="verdana12pt">
<asp:Button ID="btn_Search_Condition" runat="server" Text="Search" CssClass="verdan12pt"
Width="200" OnClick="btn_Search_Click" />
<input type="reset" value="Clear" class="verdana12pt" style="width: 200px" /></td>
</tr>
</table>
</ContentTemplate>
</ajaxToolKit:TabPanel>
</ajaxToolKit:TabContainer>
<asp:UpdatePanel ID="up_Style_Sheet" runat="server" UpdateMode="conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btn_Search_Blur" />
</Triggers>
<ContentTemplate>
<span class="verdana12pt">
<asp:LinkButton ID="lbtn_First" runat="server" Text="|< 首页" CommandArgument="First"
OnCommand="MovePage"></asp:LinkButton>
<asp:LinkButton ID="lbtn_Pre" runat="server" Text="<上一页" CommandArgument="Pre"
OnCommand="MovePage"></asp:LinkButton>
<asp:LinkButton ID="lbtn_Next" runat="server" Text="下一页>" CommandArgument="Next"
OnCommand="MovePage"></asp:LinkButton>
<asp:LinkButton ID="lbtn_Last" runat="server" Text="尾页>|" CommandArgument="Last"
OnCommand="MovePage"></asp:LinkButton><br />
共 <asp:Label ID="lbl_Sum_Count" runat="Server" Text="10" ForeColor="red"></asp:Label> 页中的第 <asp:Label
ID="lbl_Current_Index" runat="Server" Text="1" ForeColor="red"></asp:Label> 页 <asp:TextBox
ID="tb_pageIndex" runat="server" Width="50px"></asp:TextBox> <asp:LinkButton
ID="lbtn_Go" runat="server" Text="到页数" CommandArgument="Go" OnCommand="MovePage"></asp:LinkButton>
</span>
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
<tr bgcolor="#EFEFEF">
<th style="white-space: nowrap;" class="verdana12pt" onmouseover="this.style.cursor='hand';chgBg(this,'#CDCDCD')"
onmouseout="chgBg(this,'#EFEFEF')">
Style Number</th>
</tr>
<asp:Repeater ID="rep_Style_sheet" runat="server">
<AlternatingItemTemplate>
<tr class="verdana12pt" style="background-color: #EFEFEF;" onmouseover="this.style.cursor='hand'; c = this.style.backgroundColor; this.style.backgroundColor = '#666666'"
onmouseout="this.style.backgroundColor = c">
<td align="left" valign="top">
<%# Eval("Style_Code") %>
</td>
</tr>
</AlternatingItemTemplate>
<ItemTemplate>
<tr class="verdana12pt" style="background-color: White;" onmouseover="this.style.cursor='hand'; c = this.style.backgroundColor; this.style.backgroundColor = '#666666'"
onmouseout="this.style.backgroundColor = c">
<td align="left" valign="top">
<%# Eval("Style_Code") %>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
因为问题是btn_Search_Blur是tabContainer1中的!!
所以<Triggers>不要设置!!
按btn_Search_Blur时需要刷新的用代码!!
在btn_Search_Blur的click事件中打入以下代码,进行异步刷新,如:up_Style_Sheet.Update();