Question : C# ASP.NET code hanging for no reason...

The attached code hangs and then the page returns.

the line that generates the error is: importedListGridView.DataBind();
actually if i remove it the datagrid displays.. i thought that u needed to call the databind method to actually have the data in the grid...

so two questions.. why does it drop the request.. and why donti need .databind

// thefollowing is teh standard google chrome page that opens when the requested page is not found or did not respond.
This webpage is not available.

The webpage at http://client.myexpressship.com/ebay/ImportListings.aspx might be temporarily down or it may have moved permanently to a new web address.

  More information on this error
Below is the original error message

Error 101 (net::ERR_CONNECTION_RESET): Unknown error


thanks.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
DataTable dtImportedListings = new DataTable();
        dtImportedListings = ebayService.Import_GetImportedListings(intClientID);

        try
        {
            if (dtImportedListings.Rows.Count > 0)
            {
                DataView dvImportedListings = new DataView(dtImportedListings);
                importedListGridView.DataSource = dvImportedListings;
                importedListGridView.DataBind();
            }
            else
            {
                importedListGridView.DataSource = null;
                importedListGridView.DataBind();
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message + ex.StackTrace);
        }

Answer : C# ASP.NET code hanging for no reason...

i think u cant have OnDataBinding="productsListGridView_DataBind" on in
<asp:GridView ID="productsListGridView" runat="server" OnDataBinding="productsListGridView_DataBind"

because in ur bind method below when you execute productsListGridView.DataBind();
its like calling the bind method agian.. so its prolly going into an infinite recursive loop..and then the request times out..

so i basically removed OnDataBinding="productsListGridView_DataBind", and renamed the method to BindGrid
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
#region EventHandler : productsListGridView_DataBind
    protected void productsListGridView_DataBind(object sender, EventArgs e)
    {
        int intClientID = -1;
        //if (Request.Cookies["ClientID"] != null && Request.Cookies["ClientID"].Value != "")
        //{
         //   intClientID = Int32.Parse(Request.Cookies["ClientID"].Value);
        //}
        Response.Write(intClientID);
        DataTable dtProducts = new DataTable();
        //dtProducts = ebayService.Import_GetClientProducts(intClientID);
        try
        {
            if (dtProducts.Rows.Count > 0)
            {
                //DataView dvProducts = new DataView(dtProducts);
                //productsListGridView.DataSource = dvProducts;
                //productsListGridView.DataBind();
            }
            else
            {
                productsListGridView.DataSource = null;
                productsListGridView.DataBind();
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message + ex.StackTrace);
        }

    }
    #endregion EventHandler : searchCarrierDropDownList_DataBinding
Random Solutions  
 
programming4us programming4us