Visual Studio 2008 adds update panel triggers automatically
I have a aspx page that has a UpdatePanel with a radio button as a trigger for the update panel.
If add anything to the update panel (even a space!) Visual Studio automagically adds the following code in the trigger
<system.web.ui.asyncpostbacktrigger controlid="rdbServicesInvoice"
eventname="CheckedChanged"></system.web.ui.asyncpostbacktrigger>
But I already have an asp:AsyncPostBackTrigger in the trigger block.
<Triggers>
<asp:AsyncPostBackTrigger ControlID="rdbServicesInvoice" EventName="CheckedChanged" />
<system.web.ui.asyncpostbacktrigger controlid="rdbServicesInvoice"
eventname="CheckedChanged"></system.web.ui.asyncpostbacktrigger>
</Triggers>
I've read another post that states the AJAX control library must be registered. I believe that is what I have done below:
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlTool开发者_运维知识库kit" tagprefix="cc1" %>
Why does Visual Studio keep on adding the first referecned line which then breaks the page as it errors with the message System.Web.UI.UpdatePanelTriggerCollection must have items of type 'System.Web.UI.UpdatePanelTrigger'. 'System.Web.UI.AsyncPostBackTrigger' is of type 'System.Web.UI.HtmlControls.HtmlGenericControl'. How can I stop this???
Don't know if you solved already but in my case, just switched the build framework from 2.0 to 3.5.
This is done by right clicking on the project name (top of solution explorer) and select "Property Pages". from there, select build option and change the framework.
It should update web.config and all needed references.
HTH
Dave
精彩评论