Ajax seems to work only in one of my content areas

T

tshad

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
 
G

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

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
 
T

tshad

Alexey said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top