Showing posts with label installing. Show all posts
Showing posts with label installing. Show all posts

Wednesday, March 21, 2012

Errors with all UpdatePanels after installing the January Release

I installed the January release yesterday and am now getting a strange error with all of my update panels. It happens in both the existing Atlas application I was working on, and in a new test project I created to test the error.

I get the follow message box when any postback action is taken inside an update panel:

An async postback was caused by a control within UpdatePanel '$TestPanel' but the panel could not be found in the page.
I was having no trouble out of the December release, and the update panel that it says it can't find is there (minus the $). I would appreciate any ideas on a fix.

Got it. I fibbed a bit in my previous post, the $TestPanel isn't their exactly, it's missing the underscore I prefix my control ids with. It appears this bug was introduced in the January release.

As soon as I renamed my UpdatePanel from "_TestPanel" to "TestPanel", everything worked as expected.


Hi Nick,

How do you rename from _TestPanel to TestPanel ? Please help me I have the same problem.


Can you post a quick sample repro of what failed for you?
Create the following in page, notice the Update Panel's ID is prefixed with a "_".
<form id="form1" runat="server">
<atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server" />
<div>
<atlas:UpdatePanel ID="_Test" Mode="Always" runat="server">
<ContentTemplate>
<asp:TextBox ID="_SomeTextBox" runat="server">
</asp:TextBox>
<asp:Button ID="_SomeButton" runat="server" />
</ContentTemplate>
</atlas:UpdatePanel>
</div>
</form
When you run this sample, and push the button, you should get the error described in the first post. Now, take out the underscore in the Update Panel's name, like this:

<form id="form1" runat="server">
<atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server" />
<div>
<atlas:UpdatePanel ID="Test" Mode="Always" runat="server">
<ContentTemplate>
<asp:TextBox ID="_SomeTextBox" runat="server">
</asp:TextBox>
<asp:Button ID="_SomeButton" runat="server" />
</ContentTemplate>
</atlas:UpdatePanel>
</div>
</form
Run it again, and it error is gone.
OK, thanks for the sample Nick. Essentially, the code in the server looking for the Panel is not handling the leading "_".

Just to follow up, this happens any time part of the UpdatePanel's ID has an underscore in it, not just a leading underscore. This also happens if you have other naming containers, such as Content controls in Master Page scenarios, that have underscores in their names.

For the meantime, just remove the underscores. This issue will be fixed in a future release of Atlas.

Thanks,

Eilon


Does this problem happen for other reasons? I have made sure that I have no underscores in any of my master/content/container controls, but I still get that message. The difference is that in my page source, the update panel is named with underscores like: "_ctl0_cphMain_upMyPanel", but in the JS alert window, its referred to as "$ctl0$cphMain$upMyPanel".

The weird thing is that the update panels update when a control event for a control that is NOT in an update panel is fired. The only time it throws the alert is when a control WITHIN one of these update panels is fired.

ANY help is appreciated! Thanks!!!!!!

--
tb


Hi tb,

The problem is happening because of "_ctl0" - though I'm not sure what control that is. If you can figure out what control that is, give it a specific name so that it doesn't get autogenerated to "_ctl0".

Thanks,

Eilon


I think this might be a bug with master pages. the cphMain part of that control id is the content placeholder on my master page. that would lead me to believe that the "_ctl0" is coming from something outside of that tag.

I have tried to change the form name on the master page, since thats the only server control that surrounds my content placeholder (cphMain), but when the controls are rendered, every single one of them has a "_ctl0" at the front of the id, and the rendered form id is still "aspnetForm".

Any thoughts? Thanks!

Errors after Installing RC1 and the Dec CTP

Getting this one again: The type or namespace name 'UI' does not exist in the namespace 'Microsoft.Web' (are you missing an assembly reference?)

The following that I have checked:

1.) Made sure the System.Web.Extensions.dll was in the bin folder

2.) Copied and renamed the Web_CTP.config file to web.config and added it to my project

Anyone else hit this?

Make sure the dlls are in the GAC
Dropped them in the GAC, still no love.

Rick

Last step I know, check your web.confighttp://alpascual.com/blog/al/archive/2006/10/24/Manually-upgrading-from-Atlas-to-ASP.NET-2.0-Ajax.aspx


Little more information:

Created a new website for kicks on the same machine using the Ajax CTP Template. Works fine. Did a diff on the two web.config files and the only difference was:

<buildProviders>
<add extension="*.asbx" type="Microsoft.Web.Preview.Services.BridgeBuildProvider"/>
</buildProviders>

Took this out because it can only be placed in the top level of the site. Is there a problem with using this web.config file or adding AJAX specific settings in a folder below the root? I originally had all of this stuff in the top level web.config file, but was causing the problems described above so moved it ot the folder in which my ajax code was located.


It sounds like your referencing "Microsoft.Web" in your code somewhere (markup or code behind). The namespacing has all changed, so you'll need to modify all your existing references accordingly.
No references to that NS anywhere...
No references to that NS anywhere...
hello.

you're?talking?about?a?top?web.confg?file...are?you?saying?that?your?app?is?a?subdir?of?another?web?app??if?so,?then?you?should?make?sure?that?your?top?web?app?is?configured?to?use?asp.net?2.0?and?the?ajax?entries?should?be?put?in?that?top?condig?file.

another thing you should do: check for the scriptresourcehandler. make sure it's on your web?.config file. if this still doesn't solve your problem, use fiddler to see what you're getting from the server and then let us know.
MS changed the namespace in RC1 to System.Web.Extensions, this might be your problem. I had old statements in web.config from Beta 2 for Microsoft.Web.Extensions. I changed it to System and wham, it works. Give it a whirl.