How do I update nopCommerce modules .cs files?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
This may be a stupid question but I have nopCommerce installed and I am going to customize the ProductAttributes.cs file in the Modules folder.  I have the project pulled up in Visual Studio 2010.  When I mod the .cs file and then Build the website nothing changes on my site.  However I can modify the ProductAttributes.ascx file and I will see the changes on the site.  Can someone help me with this.  I have been trying to get this for two days.  It's making me feel stupid.  I shouldn't have to rebuild a .NET 4.0 project to see the changes on the site however I can rebuild this app and still NOT see the changes.


Thanks.
12 years ago
ajones wrote:
This may be a stupid question but I have nopCommerce installed and I am going to customize the ProductAttributes.cs file in the Modules folder.  I have the project pulled up in Visual Studio 2010.  When I mod the .cs file and then Build the website nothing changes on my site.  However I can modify the ProductAttributes.ascx file and I will see the changes on the site.  Can someone help me with this.  I have been trying to get this for two days.  It's making me feel stupid.  I shouldn't have to rebuild a .NET 4.0 project to see the changes on the site however I can rebuild this app and still NOT see the changes.


Thanks.


Do you have the source code or did you just install the binary project? Can you share what the modification is you're trying to make?
12 years ago
I downloaded the source code, created a project folder on my server and pointed my IIS virtual directory to that folder. I am trying to modify the ProductAttributes.cs file to make the drop down box autopostback so I can show a different picture based on the attribute selected (I know this will require more mods than what I am discussing here).  I am just trying to get the dang project to update when I rebuild it.  The source location I am changing is below:

ProductAttributes.cs file

In the CreateAttributeControls method

switch (attribute.AttributeControlType)
                        {
                            case AttributeControlTypeEnum.DropdownList:
                                {
                                    var ddlAttributes = new DropDownList();
                                    ddlAttributes.ID = controlId;
                                    divAttribute.Controls.Add(ddlAttributes);
                                    --NEW CODE HERE
                                    ddlAttributes.AutoPostBack = true;
12 years ago
ajones - what version are you using?  If it is v2.0+, you aren't in ASP.NET web forms any longer.  You need to study the MVC model.  AutoPostback on a ddl doesn't work - you'd need to set an "onchange" event - see http://stackoverflow.com/questions/730800/c-how-to-set-the-autopostback-property-when-using-asp-net-mvc
12 years ago
Thanks for the response.  I have already tried that.  I created an onchange event in the CS file and created the javascript function on the ascx page.  Again you can see the newly created javascript function on the ascx page but the backend code just doesn't work.  

Here is what is hilarious.  I actually deleted the ProductAttributes.ascx.cs file and the dang page still loads up just fine even after restarting my server and my client.  This is the strangest behavior I have ever seen.  

Has anyone actually modified the CS files in the Modules folder before successfully?
12 years ago
what version of code do you have?
12 years ago
viperguynaz wrote:
what version of code do you have?


Based on the references to ascx files it isn't 2/2.1
12 years ago
couldn't find the referenced file in 1.9 either - time for an upgrade!
12 years ago
I had version 1.9 installed.  I just upgraded to 2.10.  I am loading it up in VS2010 ultimate now and going to try and make my changes.  Thanks for your help.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.