about view all link button

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
Hello there....

i have added a link button "View All " to the products in grid & products in line 1 page..... by which a user can view alll the products in the same page.... the code is----

<asp:LinkButton runat="server" Text="ViewAll" CssClass="Viewallhyperlink"
                 OnCommand="dl_viewall" CommandArgument="dlnew" CommandName="Viewall"></asp:LinkButton>

and code--------------



        protected void dl_viewall(object sender, CommandEventArgs e)
        {
            LinkButton lb = (LinkButton)sender;
            // DataList dl = (DataList)lb.Parent.Parent.Parent.Parent;

            if (lb.CommandName == "Viewall")
            {
                dlProducts.DataSource = ProductManager.GetProductsByCategory(CategoryId);
                dlProducts.DataBind();
            }
        }

in product manager class i have added the method---------




public static List<Product> GetProductsByCategory(int categoryId)
        {
            var context = ObjectContextHelper.CurrentObjectContext;
            var query = from pid in context.Products
                        from pcmid in context.ProductCategories
                        where pid.ProductId == pcmid.ProductId && pcmid.CategoryId == categoryId
                        select pid;
            var queryrestul = query.ToList();
            return queryrestul;


  
        }

it works fine on local server....i have uploaded it on web server via fireftp.........i uploaded all of these files on the server..... bt it gives me an error while clicking on categories--------


Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'ASP.templates_categories_productsingrid_ascx' does not contain a definition for 'dl_viewall' and no extension method 'dl_viewall' accepting a first argument of type 'ASP.templates_categories_productsingrid_ascx' could be found (are you missing a using directive or an assembly reference?)

Source Error:


Line 70:             AutoPostBack="true" />
Line 71:         <div style=" margin-left: 130px; margin-top: -20px;">
Line 72:          <asp:LinkButton ID="viewalllinkbtn" runat="server" Text="ViewAll" CssClass="Viewallhyperlink"
Line 73:                  OnCommand="dl_viewall" CommandArgument="dlnew" CommandName="Viewall"></asp:LinkButton>
Line 74:         </div>

Source File: \\fsc01-s01\wwwroot$\justlinen.com\wwwroot\Templates\Categories\ProductsInGrid.ascx    Line: 72

i can't find what exactly the error is.....can u please help me.......do needful as early as possible......
13 лет назад
Have you uploaded recompiled NopCommerceStore.dll file into \Bin directory?
13 лет назад
no
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.