Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Polity 5 posts 30 karma points
    Jul 09, 2010 @ 14:14
    Polity
    1

    Nested master pages, controls not doing a right postback

    Hi Guys,

    This is really weird:

    I have a masterpage
    Under that i have a nested master page.

    Once i place a button on the nested master, hook the onclick on some random method and invoke it, i never get a postback. Well, in firebug i see a postback beeing made, a post is made, the viewstate and some hidden fields are send and everything is looking fine.

    When on the server, i put a breakpoint on PageLoad and quess what. Page.IsPostback is ALWAYS false. No matter how many times i press the button, try another event or whatsoever. Its always false. Also the actual method subscribed to the event is never called and the viewstate is never loaded

    When moving the button UP one level to the root master page, Eveything is ok, I  get a nice postback, event subsribers are called and the viewstate is restored.

    I've checked for both asp.net syntrax errors and html syntax errors and there were none .

    The problem can be seen live at: http://www.vvvarnhemnijmegen.nl/arrangementen

    When clicking a checkbox, a postback is made which is good but never caught on the server.

    This makes my brain hurt, please help!

     

     

    Below i pasted the markup for a testpage, this is all there is and its not working -_- (missing closing t 

     

    <%

     

    @ Master Language="C#" MasterPageFile="/masterpages/PageWithNavigation.master" AutoEventWireup="True" Inherits="InfoCaster.VVVArnhemNijmegen.masterpages.NewArrangementen" CodeBehind="~/masterpages/NewArrangementen.master.cs" %>

     

     

     

    <asp:Content ContentPlaceHolderId="Content" runat="server">

     

     

     

    <asp:Button runat="server" Text="test" OnClick="test_clicked" />

     

    </

     

    asp:Content>

     

     

     

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jul 09, 2010 @ 15:05
    Sebastiaan Janssen
    0

    Obvious question: Is there a <form runat="server"> tag around the contentplaceholder?

  • Polity 5 posts 30 karma points
    Jul 09, 2010 @ 15:13
    Polity
    1

    Yeh, way up in the root masterpage (when not counting the umbraco master page)

    Its outside any ContentPlaceHolders so it cant be overwritten by nested masterpages. Also, there are no form tags in the nested masterpages, just the one in the root.

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Jul 09, 2010 @ 16:37
    Stefan Kip
    0

    Problem is fixed.

    In the masterpage were three imagebuttons with the postbackurl property set... Apparently this messes with the normal other postbacks

Please Sign in or register to post replies

Write your reply to:

Draft