Update panel freezes the page

I have a web page with two update panel controls (search and search result). The button search onclick event just gets new data table based on the search criteria and binds to the gridview control. The page works as expected (first or second time) but after a few trys, it just freezes. I debug the app and onclick event to the end of the sub and it works fine (new data table created and bound to the gridview)  but when I press F5 to continue, the whole page just freezes. Not sure what to check for next???

    <asp:UpdatePanel ID="upSearchFilters" runat="server">
        <ContentTemplate>
            <asp:TextBox ID="txtStructureID" runat="server"></asp:TextBox>
            <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="upSearchResults" runat="server" >
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
        </Triggers>        
      <ContentTemplate>
            <asp:Panel ID="pnlSearchResults" runat="server" CssClass="gridsearch">
                <asp:GridView ID="gvSearchResults" runat="server" CellPadding="3" AutoGenerateColumns="False">
                    <Columns>
                        <asp:TemplateField HeaderText="Bridge Name" SortExpression="grid_Bridge_Name">
                            <HeaderStyle Wrap="False" />
                            <ItemTemplate>
                                <asp:Label ID="lblgrid_Bridge_Name" runat="server" Text='<%# Bind("grid_Bridge_Name") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                  .....more template fields

                    </Columns>                  

                    <FooterStyle BackColor="#006633" Font-Bold="True" ForeColor="White" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <EditRowStyle BackColor="#999999" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <PagerStyle BackColor="#006633" ForeColor="White" HorizontalAlign="Center" />
                    <HeaderStyle  BackColor="#006633" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                    <AlternatingRowStyle BackColor="Gainsboro" ForeColor="#006633" />
                   
                </asp:GridView>
            </asp:Panel>      
        </ContentTemplate>
    </asp:UpdatePanel>
xyzluckyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wayne BarronAuthor, Web DeveloperCommented:
I have asked to have this Question to be Re-Zoned, as this is a .NET Application not ASP Classic.

For Future Reference, when dealing with ASP.NET Questions, please assign them to zone:
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/

Good Luck
Carrzkiss
0
David RobitailleAnalyst ProgrammerCommented:
when the page "freese" do you get a error?
When you are using update panels, sometime the error is shown an the bottum of the page as a yellow exclamation mark.
you could also tempararly change the AsyncPostBackTrigger to a PostBackTrigger to see what really happen.
When you hit the breackpoint, you could also try to hit F11 instead of F5 to see if any other code is executed.
you aspx code look good, so i suspect the problem is on the server side code. coul you provide some?
 
0
xyzluckyAuthor Commented:
I did hit F11 and it just did not get anywhere, just the hourglass and nothing else no error. here is the server code, the records return from the seach is correct and everything runs fine until the end of
RefreshSearchResults();


    protected void btnSearch_Click(object sender, EventArgs e)
    {
        this.btnSearch.Focus();
        this.Search.StructureID = this.txtStructureID.Text;
        this.Search.BridgeNumber = this.txtBridgeNo.Text;
        this.Search.ContractNumber = this.txtContractNo.Text;
        this.Search.CountyName = this.txtCounty.Text;
        this.Search.Route1 = this.txtRoute1.Text;
        this.Search.Route2 = this.txtRoute2.Text;
        this.Search.IsShowOnRoutesSpecified = this.chkRouteSpecified.Checked;
        this.Search.MilePost1 = 0;
        this.Search.MilePost2 = 0;

        if (!string.IsNullOrEmpty(this.txtMilepostRangeFrom.Text))
           this.Search.MilePost1 = Convert.ToDecimal(this.txtMilepostRangeFrom.Text);
        if (!string.IsNullOrEmpty(this.txtMilepostRangeTo.Text))
            this.Search.MilePost2 = Convert.ToDecimal(this.txtMilepostRangeTo.Text);

        this.SetSession(m_strSessionSearchResult, new DataView(this.Data.GetSearchResult(this.Search)));

        RefreshSearchResults();
    }

    protected void RefreshSearchResults()
    {
        DataView dv = this.GetSession<DataView>(m_strSessionSearchResult);
        if (dv.Table.Rows.Count == 1)
        {
            this.Response.Redirect("CurrentBridge_Info.aspx?id=" + dv.Table.Rows[0][0].ToString());
        }
        else
        {
            this.gvSearchResults.DataSource = dv;
            this.gvSearchResults.DataBind();
        }

        if (dv.Table.Rows.Count == 0)
        {
            this.lblError.Text = "*** No structures found that match criteria ***";
            this.lblTotalRecord.Text = "";
        }
        else
        {
            this.lblError.Text = "";
            this.lblTotalRecord.Text = "Number of Bridges: " + dv.Table.Rows.Count.ToString();
        }

    }
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

xyzluckyAuthor Commented:
I did change the AsycPostBackTrigger to PostBackTrigger and everything works fine (except it does the whole page refresh which I don't want)..
0
David RobitailleAnalyst ProgrammerCommented:
Then if it work with a PostBackTrigger, could you try it using only one (big) updatepanel instead of two?
0
xyzluckyAuthor Commented:
I just tried using one big updatepanel and same result., it works all the time with PostBackTrigger and refresh page but works only first try if I use AyncPostBackTrigger.
0
David RobitailleAnalyst ProgrammerCommented:
This look like a complex problem. Since it work with the PostBackTrigger and not with the AyncPostBackTrigger, I suspect something to loose sync. ther is anything that is outside the update panels? ther is thing like "lblError" that i dont find on the ASPX you sent...
 
0
xyzluckyAuthor Commented:
I did not want to make the text so long but lblError is just part of the UpdatePanel

    <asp:UpdateProgress ID="progSearchResults" runat="server" AssociatedUpdatePanelID="upSearchFilters">
        <ProgressTemplate>
            <center style="font-size: medium; color: #FF0000; font-weight: bold;"><img src="images/icons/spinner.gif" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Searching...</center>
        </ProgressTemplate>
    </asp:UpdateProgress>
           
    <asp:UpdatePanel ID="upSearchResults" runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="btnSearch"  />
        </Triggers>
        <ContentTemplate>

            <asp:Label ID="lblTotalRecord" style="color:black; font-size:small;" runat="server"></asp:Label>
            <asp:Label ID="lblError" style="color:#FF0000; font-size:medium;" runat="server"></asp:Label>
            <asp:Panel ID="pnlSearchResults" runat="server" CssClass="gridsearch">
                <asp:GridView ID="gvSearchResults" runat="server" CellPadding="3" AutoGenerateColumns="False">
                    <Columns>
                        <asp:TemplateField HeaderText="GUID" SortExpression="key_control_entity_gid" Visible="False">
                            <HeaderStyle Wrap="False" />
0
David RobitailleAnalyst ProgrammerCommented:
well, it was just the i did not find it, I just want to be sure that there is nothing that is sent to the client that is not updated.
While we are there, what is that this.Search object?
this.Search.StructureID = this.txtStructureID.Text;
        this.Search.BridgeNumber = this.txtBridgeNo.Text;
        this.Search.ContractNumber = this.txtContractNo.Text;
        this.Search.CountyName = this.txtCounty.Text;
        this.Search.Route1 = this.txtRoute1.Text;
        this.Search.Route2 = this.txtRoute2.Text;
        this.Search.IsShowOnRoutesSpecified = this.chkRouteSpecified.Checked;
        this.Search.MilePost1 = 0;
        this.Search.MilePost2 = 0;
 
is that something that is stored on the page??
Anyway, i`m guessing there, the important thing is that everything that is updated must be inside update panels.
0
xyzluckyAuthor Commented:
oSearch is the Search object (completely on server side) that contains all search criteria to be pssed to the SetSession to get data from the database; and yes lblTotalRecord,lblError,and gvSearchResult are the ones that need update.
0
David RobitailleAnalyst ProgrammerCommented:
Search object (completely on server side)
well, it`s what you think...
I`m not sure it appen the way you think. Try setting that object locally (into the function) and pass it as a parameter on need. you could also make function to set them and retrive them from the session variable.
With the infomration you gave me, it<s the only thing i could see to screw thing.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xyzluckyAuthor Commented:
I see what you mean. I'll try your suggestion and let you know. THANKS..
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.