0

I am coding in C#, asp.net 2.
I have a radiobuttonlist on my page which applies a rowfilter to a DataView and bind it to a GridView control on each selectedindexchanged event.

When I click on the radiobuttonlist only sometimes I get the General Internet Explorer error, and in some cases I do get the correct results. When I run the app on my localhost, it works fine on every click, I get this error when I publish the app on the server. What possible reasons can there be?

Please assist.
Thanx

3
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by SheSaidImaPregy
0

Page:

[<asp:RadioButtonList ID="rblFilterDetails" runat="server" RepeatDirection="Horizontal"
                                        Style="position: relative" AutoPostBack="True" OnSelectedIndexChanged="rblFilterDetails_SelectedIndexChanged" >
                                        <asp:ListItem Value="All">All Special Categories</asp:ListItem>
                                        <asp:ListItem Value="Legal">Legal</asp:ListItem>
                                        <asp:ListItem Value="Deceased" Selected="True">Deceased</asp:ListItem>                                        
                                        <asp:ListItem Value="Inactive">Inactive Accounts</asp:ListItem>
                                    </asp:RadioButtonList>

                <asp:GridView ID="gvDetails" runat="server" 
                    AllowPaging="False" 
                    AutoGenerateColumns="False" 
                    EmptyDataText="No data." 
                    OnRowDataBound="gvDetails_RowDataBound"  
                    Style="position: static">
                    <Columns>
                        <asp:BoundField DataField="Follow_Up_Code_No" HeaderText="Follow_Up_Code_No" Visible="False" />
                        <asp:BoundField DataField="Follow_Up_Group" HeaderText="Follow_Up_Group" Visible="False" />
                        <asp:BoundField DataField="Account_No" HeaderText="Account No" />
                        <asp:BoundField DataField="Handover_Date" HeaderText="Handover Date" />
                        <asp:BoundField DataField="Debt_No" HeaderText="VCB No" />
                        <asp:BoundField DataField="Surname" HeaderText="Surname" />
                        <asp:BoundField DataField="Initials" HeaderText="Initials" />
                        <asp:BoundField DataField="Client_Name" HeaderText="Client" />
                        <asp:BoundField DataField="Current" HeaderText="Current H/Over" HtmlEncode="False">
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Overdue_Amount" HeaderText="Overdue H/Over" HtmlEncode="False">
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Interest" HeaderText="Interest Raised" HtmlEncode="False"
                            Visible="False">
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Cost" HeaderText="Cost Raised" HtmlEncode="False" Visible="False">
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Paid" HeaderText="Payments Received" HtmlEncode="False">
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Balance_Amount" HeaderText="Capital Balance O/S" HtmlEncode="False">
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DeathStatus" HeaderText="Death Status" Visible="False" />
                        <asp:BoundField DataField="PaidInterest" HeaderText="PaidInterest" Visible="False" />
                        <asp:BoundField DataField="PaidCost" HeaderText="PaidCost" Visible="False" />
                    </Columns>
                </asp:GridView>/]

Code behind:

[       protected void rblFilterDetails_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();
            DataView dv = new DataView();

            ds = (DataSet)Session["Details"];
            dv = ds.Tables[0].DefaultView;

            dv.RowFilter = "";
            gvDetails.DataBind();

            switch (filter)
            {
                case "All":
                    dv.RowFilter = "";
                    gvDetails.DataSource = dv;
                    gvDetails.DataBind();
                    break;

                case "Legal":
                    dv.RowFilter = "DeathStatus = 'A' and Follow_Up_Group = 'Lawyer'";
                    gvDetails.DataSource = dv;
                    gvDetails.DataBind();
                    break;

                case "Deceased":
                    dv.RowFilter = "DeathStatus = 'D'";//"Debt_No = 5927283";
                    gvDetails.DataSource = dv;
                    gvDetails.DataBind();
                    break;

                case "Inactive":
                    dv.RowFilter = "DeathStatus = 'A' and (Follow_Up_Group = 'Write Off' or                 Follow_Up_Group = 'Close')";
                gvDetails.DataSource = dv;
                gvDetails.DataBind();
                break;
        }
        gvDetails.DataSource = dv;
        gvDetails.DataBind();
    }

Edited by mike_2000_17: Fixed formatting

0

you are databinding way too much. The thing is, if one is chosen, you databind three times. if one isn't, you databind twice. You should remove the case all and the first and last databind. Then at the end of you switch, add a default that databinds your exact code in the "All" section.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.