nopcommerce 1.70 Detail and AddtoCart button's are not working in Category.aspx page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
in ProductBox1.ascx usercontrol this following event not fire

  protected void btnProductDetails_Click(object sender, CommandEventArgs e)
        {
            int productId = Convert.ToInt32(e.CommandArgument);
            string productURL = SEOHelper.GetProductUrl(productId);
            Response.Redirect(productURL);
        }

eg. http://localhost:1675/category/29-books.aspx

when i was selected one book name say : AspPro2008 this name was rename as useing urlrewrinting

http://localhost:1675/products/114-Asp-Pro-2008.aspx -----> new url generated by nopcommerce code

i was got this url but in CategoryNavigation.ascx.cs page

  protected void CreateChildMenu(List<Category> breadCrumb, int rootCategoryId, Category currentCategory, int level)
        {
            int padding = level++ * 15;
            foreach (var category in CategoryManager.GetAllCategories(rootCategoryId))
            {
                var link = new NopCommerceLi();
                phCategories.Controls.Add(link);

                string categoryURL = SEOHelper.GetCategoryUrl(category);
                if (currentCategory != null && currentCategory.CategoryId == category.CategoryId)
                    link.CssClass = "active";
                else
                    link.CssClass = "inactive";
               link.HyperLink.NavigateUrl = categoryURL;
                link.HyperLink.Text = Server.HtmlEncode(category.LocalizedName);
                if (padding > 0)
                    link.LiLeftMargin = padding.ToString();

                for (int i = 0; i <= breadCrumb.Count - 1; i++)
                    if (breadCrumb[i].CategoryId == category.CategoryId)
                        CreateChildMenu(breadCrumb, category.CategoryId, currentCategory, level);
            }
        }

In place of categoryURL writen old url i.e http://localhost:1675/category/29-books.aspx  in place of http://localhost:1675/products/114-Asp-Pro-2008.aspx

when we click books category Detail button is not working in local site as well as on websever we can debuge a hole page but not fire the btnProductDetails_Click() event ..

Please any one have the solution then tell me .


Dipesh
12 years ago
Same issue is causing for me also.

I have changed the url rewrite .aspx to .html and every things is working fine. But on category template i have put
button with it's click event. When i do click on this button some process should be there in button click event.
When I come from the first time it is firing the button event properly from category url. but for the second time or by reloading the current page button click event does not fires. Even it not postbacking page.

Please if any one know the issue.....kindly reply.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.