Why does visual studio 2008 break my web page?

徘徊边缘 提交于 2019-12-13 01:24:25

问题


I have a aspx page that has a UpdatePanel and a asp timer. the timer tick is the trigger for the update panel.

If add anything to the update panel (even a space!) Visual Studio automagically adds the following

<Triggers>

<System.Web.UI.AsyncPostBackTrigger ControlID="tm1" EventName="Tick"></System.Web.UI.AsyncPostBackTrigger>
        </Triggers>

Even though the page has already registered the following (albeit in the same triggers section)

<Triggers>
<asp:AsyncPostBackTrigger ControlID="tm1" EventName="Tick" /> </Triggers>

So my questions are these

1) What is the difference between asp:AsyncPostBackTrigger and System.Web.UI.AsyncPostBackTrigger 2) Why does Visual Studio persist on adding this 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'. 3) How can I stop this???

I am using Visual Studio 2008 targeting a .Net 2.0 Web application project.


回答1:


Do you have the AJAX control library registered correctly for your project? Since you're targeting .Net 2.0, you'll need to add the AJAX library explicitly (it's not built in until .Net 3.5).



来源:https://stackoverflow.com/questions/1062955/why-does-visual-studio-2008-break-my-web-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!