I have a strange problem with Master Pages and Atlas. I have gone through several posts on this forum and I gathered that people were/are having problems with getting their UpdatePanels to work in the content pages. My problem is actually different and strange. My Atlas stuff works. It is my non-atlas stuff that stops working.
Here's some pseudo code (obvious code omitted for clarity)
Here's the Master
... html header stuff omitted
<body> <form id="form1" runat="server"> <atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server" /> <div> <pc:PortalHeader id="PortalHeader1" runat="server"> </pc:PortalHeader> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </form></body>
Here's the Content page
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <div> <atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="conditional"> <ContentTemplate> <asp:GridView ID="SamplingThresholdsGridView" runat="server" AutoGenerateColumns="False" AutoGenerateEditButton="True" DataKeyNames="Id,SamplingName" DataSourceID="SamplingThresholdsDataSource" Style="z-index: 100; left: 20px; position: relative" CssClass="Grid" AlternatingRowStyle-CssClass="GridOddRow" Width="686px"> <Columns> <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" Visible="False" /> <asp:BoundField DataField="SamplingName" HeaderText="Sampling Name" ReadOnly="True" SortExpression="SamplingName" /> <asp:BoundField DataField="SamplingValue" HeaderText="Sampling Value" SortExpression="SamplingValue" /> <asp:BoundField DataField="UpdateBy" HeaderText="Updated By" ReadOnly="True" SortExpression="UpdatedBy" /> <asp:BoundField DataField="UpdateDt" HeaderText="Updated Dt" ReadOnly="True" SortExpression="UpdatedDt" /> </Columns> <AlternatingRowStyle CssClass="GridOddRow" /> </asp:GridView> </ContentTemplate> </atlas:UpdatePanel> </div>
Hard to tell without seeing all the code. But, how about just putting an UpdatePanel around the PortalHeader control? I could imagine a scenario where the default visibility of a DOM element that the PortalHeader is rendered to is "hidden" by default but is set to "visible" by some other page control on page load but not during asynchronous postbacks (postback from an UpdatePanel). So check the style of the PortalHeader. Are there UpdatePanels inside the PortalHeader?... data source omitted
</asp:Content>
Notice that my Master has a header served by a user control "PortalHeader". That's why I have Master Pages for in the first place. Needless to say, my content page refers to the
Master page (not shown). Everything was working fine. My script manager was in my "old" plain page. Then I created a master page and my "old" plain page became my Content
Page. I moved the script manager to the master page based on a lot of posts on this forum. Not that it makes a difference where I put it. Things "work", but not as I want them to be.
When I hit "Edit" on my data grid, the "header" served by PortalHeader in my master page dissappears !!! Other than that, the UpdatePanel works perfectly. I never get the header
unless I reload the page. It does not matter whether I "Update" or "Cancel" my "Edit". When I view the html source in the browser, every time I see my header HTML, but it stops
getting rendered.
In conclusion, UpdatePanel is working as expected EXCEPT that my Master Page is broke. I simply remove the UpdatePanel/ContentPane tags around my grid view and my header
is back! But then I cannot use Ajax!.
I'm at the point where I'm thinking of putting my "PortalHeader" control in each content page. But then I don't need Master Pages at all.
Help !!!
No comments:
Post a Comment