Wednesday, March 21, 2012

Atlas problem with page base class structure

Hi there,

I'm working on a ASP.NET 1.1 application that was converted to 2.0. Instead of using master pages and templates in uses inherited base page classes to ensure consistancy of look, feel and functionality across all the pages.

The base class from which all pages inherit builds the html structure of the page. All that's in aspx page is:

<%@dotnet.itags.org. Page language="c#" Inherits="F360.PresentationTier.Testing.AJAX" CodeFile="AJAX.aspx.cs"%>
<head runat="server" id="headTag" />
CodeBehind is:
public partial class AJAX : BasePageHtmlAndNav

When creating pages the developer can drop in controls into the aspx page but the headers, footers, structure and menus etc are all built by the base page in OnInit

Ok, on to my ATLAS issue:

I've tested a simple updatePanel using a standard WebForm template and it works great. However when I try to add a ScriptManager and UpdatePanel to a page derived from our base class structure described above the updatePanel doesn't update. An asynchronous postback is made and the server-side event is triggered but the contents of the panal doesn't change.

I know it's hard to fathom what's going on here without full details of our base page class structure but if anyone has any ideas I'd appreciate it as I'm very keen to integrate the ATLAS framework in future applications that we'll be developing here.

Many thanks

MatOk, having read some posts on ATLAS problems with Master pages I did some tinkering and found the strangest (to me) of issues. ATLAS works fine with the base class structure outlined in my previous if there are no linked style sheets in the <head> tag. As soon as I add a style sheet (dynamically) to the head tag at runtime (as a LiteralControl) the updatePanel does not refresh. Does anyone have any idea why tis might be?

N.B. It makes no difference what is in the stylesheet. The problem still occur even when the links style sheet is empty.

Thanks

Mat

hello.

well, i'd say that you're generating a non valid xml element, ie, you're probably not closing the html element that is being sent to the browser. you can easilly verify this by using fiddler. what you must know is that, currently, the contents of the head section (if you have it with runat="server") are sent inside an xml message generated by the server in response to a partial postback and they aren't eascaped by using a cdata section. so, it's important to make sure that the contents of the head element are well formed xml elements.

btw, the correct way to identify a stylesheet to the page is to sue the htmllink element:

HtmlLink link = new HtmlLink( );
link.Href = "caminho ate Css file";
link.Attributes.Add( "rel", "stylesheet" );
link.Attributes( "type", "text/css" );
this.Header.AddParsedSubObject( link );


Hi there,

Thanks for the info. You were spot on. One of the style tags wasn't closed and when I corrected that worked... kind of!

The first postback is fine. However on the second postback I get the following error and IE crashes:

Unhandled exception at 0x7dd47bb3 in IEPLORE.EXE: 0xCOOOOOO5:
Access violation reading 0x0000004
Any ideas anyone?

And thanks for the tip regarding stylesheet link. I'll sort that out.

Mat


hello.

can you test that in another browser? it may be a problem with your ie...


Thanks for you're assistance. I got to the bottom of it in the end. I doubt anyone else will have a similar issue but I'll outline it anyway.

The application I'm working on used a CSS unorder list dropdown menu, as descibed here:http://www.tanfa.co.uk/css/examples/menu/tutorial-v.asp

To make the menu work correctly in IE an htc behaviour had to be attached to the body tag in the stylesheet. It was this beahviour that was causing IE to crash when asynchronous calls were being made. (No idea why). When I removed the behavious ATLAS worked fine. I have since changed the very light CSS menu for a third party control and now have both ATLAS functionality and a funky new menu. All good.

Thanks again

Mat


Can you explain better the solution...?
I have exactly the sameproblem... and I use a similar menu fromWebFX and I followed your linkbut I don't understand what's the problem generating the crash muchless the solution proposed...

Thanks
Agapito

No comments:

Post a Comment