Gridview and Modal popup not updating

Posted by rs on Stack Overflow See other posts from Stack Overflow or by rs
Published on 2010-03-19T17:20:44Z Indexed on 2010/03/19 17:31 UTC
Read the original article Hit count: 547

Filed under:
|
|
|
|

I have page with following controls

<asp:UpdatePanel ID="up1" runat="server" UpdateMode="Conditional">
<ContentTemplate>   
    <uc2:CountryControl ID="Country1" runat="server" />                
    <br class = "br_e" /> <br class = "br_e" />
    <asp:UpdatePanel ID="upCountry2" runat="server" UpdateMode="Conditional">
    <ContentTemplate>  
    <asp:Panel runat="server" ID="pnCountry" Width="400px" Visible="false"> 
        <asp:GridView ID="gvCountry" runat="server" 
            AllowSorting="true" 
            DataKeyNames="countryid" DataSourceID="data_country1"
            AutoGenerateColumns="false">
            <Columns>
                <asp:CommandField ButtonType="Link" ShowDeleteButton="true" />
                <asp:BoundField HeaderText="Country" DataField="CountryName" SortExpression="CountryName" />                
            </Columns>
        </asp:GridView>     
        <asp:SqlDataSource ID="data_country1" runat="server" 
             ConnectionString="<%$ zyx %>"                                                   
             SelectCommand="xyz"
             SelectCommandType="StoredProcedure">                                               
             <SelectParameters>     
                <asp:SessionParameter Name="country" 
                    DefaultValue="" ConvertEmptyStringToNull="true"
                    SessionField="CountryID" Type="String" />               
             </SelectParameters>  
        </asp:SqlDataSource>                                                       
    </asp:Panel> 
    </ContentTemplate>
</asp:UpdatePanel>                       
</ContentTemplate>
</asp:UpdatePanel>

My user control is a modal popup to select country and add selected ids to a session variable. And in main page bind data using ids in session variable.Gridview - on deleting event i'm deleting that id from session and on deleted event updating both user control using a refresh method (Country1.Refresh()) and gridview panel.

But updatepanel is not getting updated and even modalpopup is also not getting refreshed. What could be wrong here? Even though update and refresh events are fired and executed, why is page not getting updated?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about ASP.NET