با سلام من یک سایت طراحی کردم و آپلود شده ، مشکل اینجاست که وقتی روی یک منو کلیک میکنم گاهی ارور زیر رو نمایش میده و به صفحه ای که محصولاتم داخلش هست نمیره اما گاهی که روی همون منو کلیک میکنم کاملا صحیح اجرا میشه و محصولاتم رو نمایش میده . و قابل ذکر هست که با استفاده از json برای ارسال id به صفحه موردنظر استفاده کردم..
و روی لوکال هم اصلا این ارور رو نمیده..میشه لطف کنید بگید علتش چی میتونه باشه ، گاهی این ارور رو میده گاهی نمیده.
کدتون رو قرار بدید تا بررسی کنیم مشکل کجاست
این کدی هست که برای نمایش محصول فراخوانی میشه. private void displaypoductfull() { int countbrand = chlist.Items.Count; int pageindex = Convert.ToInt32(ViewState["pageindex"]); int s = 0; string brand_ids = ""; for (s = 0; s < countbrand; s++) { if (chlist.Items[s].Selected) { brand_ids += chlist.Items[s].Value + ","; } } int name = Convert.ToInt32(Session["productname"]); int type = Convert.ToInt32(Session["producttype"]); MusicDevice_Device obj = new MusicDevice_Device(); Music_Device_Parent_Menu obj3 = new Music_Device_Parent_Menu(); int countecord = 0; DataTable dt3 = new DataTable(); dt3 = obj3.Get_ById_In_Music_Device_Parent_Menu(type); string type_name = Convert.ToString(dt3.Rows[0]["Music_Device_Parent_Menu_Descrip"]); if (type_name.Trim() == "سیم") { widthdisplay(); } if (type_name.Trim() == "پیک") { picdisplay(); } int start = 0; int end = 0; if (!this.IsPostBack) { start = Convert.ToInt32(ViewState["Min"]); end = Convert.ToInt32(ViewState["Max"]); int inc = 0; if (start == 0) { inc = 1; } else { inc = end / (end / start); if (inc >= 100000) { MultiHandleSliderExtender1.Increment = 50000; } if (inc >= 10000 & inc < 100000) { MultiHandleSliderExtender1.Increment = 5000; } } ViewState["ince"] = inc; } else { //تعیین نقطه شروع start = !string.IsNullOrEmpty(Request.Form[hfStart.UniqueID]) ? int.Parse(Request.Form[hfStart.UniqueID]) : 0; //تعیین نقطه انتها end = !string.IsNullOrEmpty(Request.Form[hfEnd.UniqueID]) ? int.Parse(Request.Form[hfEnd.UniqueID]) : 0; lblsliderminvalue.Text = string.Format("{0:N0}", start); lblSliderValue.Text = string.Format("{0:N0}", end); MultiHandleSliderExtender1.Increment = Convert.ToInt32(ViewState["ince"]); } //نمایش نقطه شروع و انتها { { { DataTable dt = new DataTable(); if (name == 0) { if (brand_ids != "") { dt = obj.Price_in_brands(type, pageindex, pagesize, start, end, brand_ids); countecord = obj.price_In_barnds_count(type, start, end, brand_ids); } else { dt = obj.Music_In_Device_DisplayProducts_Price(type, pageindex, pagesize, start, end); countecord = obj.SP_In_productitemstype_count_Price(type, start, end); } } else { if (brand_ids != "") { dt = obj.price_In_bands_name(type, name, pageindex, pagesize, start, end, brand_ids); countecord = obj.price_In_count_brand_name(type, name, start, end, brand_ids); } else { dt = obj.Music_Device_In_Get_All_Products_Price(type, name, pageindex, pagesize, start, end); countecord = obj.SP_productitems_count_In_Price(type, name, start, end); } } string div1 = ""; string div2 = ""; string img = ""; string div3 = ""; string div4 = ""; string div5 = ""; string div6 = ""; string div7 = ""; string productname = ""; string div9 = ""; int price = 0; string div = ""; int rating = 0; int Rating_count = 0; int rate = 0; int product_id = 0; string imagerate = ""; string div8 = ""; int newprice = 0; int discount = 0; int count = 0; for (int i = 0; i < dt.Rows.Count; i++) { rating = Convert.ToInt32(dt.Rows[i]["rating"]); Rating_count = Convert.ToInt32(dt.Rows[i]["rateing_count"]); rate = ratestar(rating, Rating_count); imagerate = imagesetrating(rate); img = "Admin/Admin/Image/Device/" + Convert.ToString(dt.Rows[i]["images"]); productname = Convert.ToString(dt.Rows[i]["name"]); price = Convert.ToInt32(dt.Rows[i]["price"]); discount = Convert.ToInt32(dt.Rows[i]["discount"]); newprice = price - ((discount * price) / 100); string pr = string.Format("{0:N0}", newprice); product_id = Convert.ToInt32(dt.Rows[i]["product_id"]); count = Convert.ToInt32(dt.Rows[i]["countdevice"]); if (count > 0) { div9 = "<div class='product-price'><p style='display:inline;color:#c21111'> تومان </p><span class='product-price-new'>" + pr + "</span></div>"; } else { div9 = "<div class='product-price'><p style='display:inline;color:#c21111'> ناموجود </p></div>"; } div8 = "<div class='product-rating'><img src=" + imagerate + "></div>"; div7 = "<div class='product-name'><span>" + productname + "</span></div>"; div6 = @"<div class='product-buttons-wrap'> <a class='button icon-cart' onclick=AddToCart(" + product_id + @")>افزودن به سبد خرید</a><br> <a class='compare-link' href=product.aspx?id=" + product_id + @">بررسی</a> <a class='compare-link' href='shoppingbasket.aspx'>لیست انتخاب</a> </div>"; div5 = "<div class='product-buttons-body'>" + div6 + "</div>"; div4 = "<div class='product-buttons'>" + div5 + "</div>"; div3 = "<div class='relative'>" + div4 + div7 + "</div>"; div2 = "<div class='product-image'><img src=" + img + "></div>"; div1 = "<div class='block-product-grid'>" + div2 + div3 + div8 + div9 + " </div>"; div += "<div class='block grid3 block-product-grid-parent'>" + div1 + " </div>"; } specialpoduct.InnerHtml = div; PopulatePager(countecord, Convert.ToInt32(ViewState["pageindex"])); if (!this.IsPostBack) { // دادن مقدار شروع hfStart.Value = Convert.ToString(ViewState["Min"]); // دادن مقدار انتها hfEnd.Value = Convert.ToString(ViewState["Max"]); //نمایش دادن مقدار ابتدا و انتها lblsliderminvalue.Text = string.Format("{0:N0}", start); lblSliderValue.Text = string.Format("{0:N0}", end); } } } } }
کد ها رو دیدم
مشکل خاصی توش نبود
باید پروژه رو چک کنید
بهتره Elmah رو روی پروژه نصب کنید تا اطلاعات دقیقتری از خطا دریافت کنید
با سپاس فراوان از راهنماییتون ، من اطلاعاتی راجع به elmah ندارم ، امکانش هست یک لینک معرفی کنید..ممنون
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)