Ajax seems to work only in one of my content areas

Discussion in 'ASP .Net' started by tshad, Oct 27, 2009.

  1. tshad

    tshad Guest

    I have a page I would like to use 2 different areas with Partial Rendering.

    I have the top area as a bunch of drop downs that I need to fill as others
    are selected. This part works fine if I have only one content area and the
    closing UpdatePanel is just below the drop downs. Only the top half of the
    screen is updated when a dropdown is selected.

    The bottom half is a button that is used to fill the Gridview that is in the
    bottom half (or more) of the screen. I have the code set up as:

    <body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="mScriptManager" runat="server"
    EnablePartialRendering="true" />
    <div>

    <!-- Progress Indicator -->
    <asp:UpdatePanel ID="pnlContainer" runat="server" >
    <ContentTemplate>

    <!-- Filter Grid -->

    <asp:panel ID="mFilterPanel" runat="server">


    All of my drop downs here

    </asp:panel>
    </ContentTemplate>
    </UpdatePanel>

    this works fine and the GridView is below that.

    I wanted to change this to also surround the GridView with a ContentTemplate
    so that only the GridView is handled when the button is pushed.

    So I tried to change the above code to look like this:

    <body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="mScriptManager" runat="server"
    EnablePartialRendering="true" />
    <div>

    <!-- Progress Indicator -->
    <asp:UpdatePanel ID="pnlContainer" runat="server" >
    <ContentTemplate>

    <!-- Filter Grid -->

    <asp:panel ID="mFilterPanel" runat="server">


    All of my drop downs here

    </asp:panel>
    </ContentTemplate>
    <ContentTemplate>

    Some Table Code

    <asp:ImageButton ID="btnRefresh"
    ImageUrl="~/images/refresh_16.gif" runat="server"
    ToolTip="Refresh Grid"
    CssClass="GridActionButton" OnClick="btnRefresh_Click"
    Style="width: 16px" />

    More Table Code

    <asp:panel ID="mGridViewPanel" style="text-align:center"
    runat="server">

    <asp:Label ID="lblGridStatus" style="color:Red;
    text-align:center" Visible="false" runat="server" />

    <asp:GridView ID="GridView1"

    .....

    </asp:panel>
    </ContentTemplate>
    </asp:UpdatePanel>

    </ContentTemplate>
    </UpdatePanel>

    Now nothing works.

    The dropdowns don't fill fill other dropdowns and the GridView doesn't work.

    All I did was move the </UpdatePanel> down and added another
    ContentTemplate.

    Is there something else I need to do to get this to work???

    Thanks,

    Tom
     
    tshad, Oct 27, 2009
    #1
    1. Advertising

  2. On Oct 27, 5:40 am, "tshad" <> wrote:
    > I have a page I would like to use 2 different areas with Partial Rendering.
    >
    > I have the top area as a bunch of drop downs that I need to fill as others
    > are selected.  This part works fine if I have only one content area and the
    > closing UpdatePanel is just below the drop downs.  Only the top half of the
    > screen is updated when a dropdown is selected.
    >
    > The bottom half is a button that is used to fill the Gridview that is in the
    > bottom half (or more) of the screen.  I have the code set up as:
    >
    > <body>
    >     <form id="form1" runat="server">
    >         <asp:ScriptManager ID="mScriptManager" runat="server"
    > EnablePartialRendering="true" />
    >         <div>
    >
    >             <!-- Progress Indicator -->
    >             <asp:UpdatePanel ID="pnlContainer" runat="server" >
    >                 <ContentTemplate>
    >
    >                 <!-- Filter Grid -->
    >
    >                     <asp:panel ID="mFilterPanel" runat="server">
    >
    > All of my drop downs here
    >
    >                      </asp:panel>
    >                </ContentTemplate>
    >         </UpdatePanel>
    >
    > this works fine and the GridView is below that.
    >
    > I wanted to change this to also surround the GridView with a ContentTemplate
    > so that only the GridView is handled when the button is pushed.
    >
    > So I tried to change the above code to look like this:
    >
    > <body>
    >     <form id="form1" runat="server">
    >         <asp:ScriptManager ID="mScriptManager" runat="server"
    > EnablePartialRendering="true" />
    >         <div>
    >
    >             <!-- Progress Indicator -->
    >             <asp:UpdatePanel ID="pnlContainer" runat="server" >
    >                 <ContentTemplate>
    >
    >                 <!-- Filter Grid -->
    >
    >                     <asp:panel ID="mFilterPanel" runat="server">
    >
    > All of my drop downs here
    >
    >                      </asp:panel>
    >                </ContentTemplate>
    >                 <ContentTemplate>
    >
    >                     Some Table Code
    >
    >                                     <asp:ImageButton ID="btnRefresh"
    > ImageUrl="~/images/refresh_16.gif" runat="server"
    >                                         ToolTip="Refresh Grid"
    > CssClass="GridActionButton" OnClick="btnRefresh_Click"
    >                                         Style="width: 16px" />
    >
    >                     More Table Code
    >
    >             <asp:panel ID="mGridViewPanel" style="text-align:center"
    > runat="server">
    >
    >                 <asp:Label ID="lblGridStatus" style="color:Red;
    > text-align:center" Visible="false" runat="server" />
    >
    >                 <asp:GridView ID="GridView1"
    >
    >                         .....
    >
    >             </asp:panel>
    >          </ContentTemplate>
    >       </asp:UpdatePanel>
    >
    >     </ContentTemplate>
    >  </UpdatePanel>
    >
    > Now nothing works.
    >
    > The dropdowns don't fill fill other dropdowns and the GridView doesn't work.
    >
    > All I did was move the </UpdatePanel> down and added another
    > ContentTemplate.
    >
    > Is there something else I need to do to get this to work???
    >
    > Thanks,
    >
    > Tom


    Do you see any javascript error? If not, turn debugging on in IE

    Tools->Internet Options…->Advanced->Disable Script Debugging

    and enable Display a notification about every script error
     
    Alexey Smirnov, Oct 27, 2009
    #2
    1. Advertising

  3. tshad

    tshad Guest

    Alexey Smirnov wrote:
    > On Oct 27, 5:40 am, "tshad" <> wrote:
    >> I have a page I would like to use 2 different areas with Partial
    >> Rendering.
    >>
    >> I have the top area as a bunch of drop downs that I need to fill as
    >> others are selected. This part works fine if I have only one content
    >> area and the closing UpdatePanel is just below the drop downs. Only
    >> the top half of the screen is updated when a dropdown is selected.
    >>
    >> The bottom half is a button that is used to fill the Gridview that
    >> is in the bottom half (or more) of the screen. I have the code set
    >> up as:
    >>
    >> <body>
    >> <form id="form1" runat="server">
    >> <asp:ScriptManager ID="mScriptManager" runat="server"
    >> EnablePartialRendering="true" />
    >> <div>
    >>
    >> <!-- Progress Indicator -->
    >> <asp:UpdatePanel ID="pnlContainer" runat="server" >
    >> <ContentTemplate>
    >>
    >> <!-- Filter Grid -->
    >>
    >> <asp:panel ID="mFilterPanel" runat="server">
    >>
    >> All of my drop downs here
    >>
    >> </asp:panel>
    >> </ContentTemplate>
    >> </UpdatePanel>
    >>
    >> this works fine and the GridView is below that.
    >>
    >> I wanted to change this to also surround the GridView with a
    >> ContentTemplate so that only the GridView is handled when the button
    >> is pushed.
    >>
    >> So I tried to change the above code to look like this:
    >>
    >> <body>
    >> <form id="form1" runat="server">
    >> <asp:ScriptManager ID="mScriptManager" runat="server"
    >> EnablePartialRendering="true" />
    >> <div>
    >>
    >> <!-- Progress Indicator -->
    >> <asp:UpdatePanel ID="pnlContainer" runat="server" >
    >> <ContentTemplate>
    >>
    >> <!-- Filter Grid -->
    >>
    >> <asp:panel ID="mFilterPanel" runat="server">
    >>
    >> All of my drop downs here
    >>
    >> </asp:panel>
    >> </ContentTemplate>
    >> <ContentTemplate>
    >>
    >> Some Table Code
    >>
    >> <asp:ImageButton ID="btnRefresh"
    >> ImageUrl="~/images/refresh_16.gif" runat="server"
    >> ToolTip="Refresh Grid"
    >> CssClass="GridActionButton" OnClick="btnRefresh_Click"
    >> Style="width: 16px" />
    >>
    >> More Table Code
    >>
    >> <asp:panel ID="mGridViewPanel" style="text-align:center"
    >> runat="server">
    >>
    >> <asp:Label ID="lblGridStatus" style="color:Red;
    >> text-align:center" Visible="false" runat="server" />
    >>
    >> <asp:GridView ID="GridView1"
    >>
    >> .....
    >>
    >> </asp:panel>
    >> </ContentTemplate>
    >> </asp:UpdatePanel>
    >>
    >> </ContentTemplate>
    >> </UpdatePanel>
    >>
    >> Now nothing works.
    >>
    >> The dropdowns don't fill fill other dropdowns and the GridView
    >> doesn't work.
    >>
    >> All I did was move the </UpdatePanel> down and added another
    >> ContentTemplate.
    >>
    >> Is there something else I need to do to get this to work???
    >>
    >> Thanks,
    >>
    >> Tom

    >
    > Do you see any javascript error? If not, turn debugging on in IE
    >
    > Tools->Internet Options…->Advanced->Disable Script Debugging
    >
    > and enable Display a notification about every script error


    I got an error right away. This was an error I got before when I tried to
    surround a section a code before but it seems to ignore the commenting.

    Content ('<!-- Process Grid -->') does not match any properties within a
    'System.Web.UI.UpdatePanel', make sure it is well-formed.

    Line 121: </ContentTemplate>
    Line 122:
    Line 123: <!-- Process Grid -->
    Line 124: <ContentTemplate>
    Line 125:

    Not sure why this is a problem.

    After I fix that problem by taking the comment out, I get this:

    The ContentTemplate of UpdatePanel with ID '' cannot be changed after it has
    been instantiated.

    Line 13: <div>
    Line 14:
    Line 15: <asp:UpdatePanel ID="pnlContainer" runat="server" >
    Line 16: <ContentTemplate>
    Line 17:

    What am I changing?

    Thanks,

    Tom
    Thanks,

    Tom
     
    tshad, Oct 27, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hazz
    Replies:
    6
    Views:
    49,637
    SkyUCHC
    Jun 9, 2010
  2. Kevin Frey
    Replies:
    0
    Views:
    479
    Kevin Frey
    Sep 19, 2006
  3. minnie
    Replies:
    1
    Views:
    713
    Andrew Thompson
    Dec 13, 2006
  4. Fabrizio J Bonsignore
    Replies:
    5
    Views:
    322
    Fabrizio J. Bonsignore syntotic
    Mar 2, 2012
  5. Replies:
    3
    Views:
    140
Loading...

Share This Page