Page 1 of 1

Unable to Edit code behind

Posted: Thu May 30, 2013 1:27 pm
by dmurphy4
I'm mostly a front - end developer and can't seem to understand why any changes to the code behind in my conlib will have no affect.

- I created a copy of the ProductImage conlib and renamed it "AACustomProductImage.ascx"
- I changed the CodeBehind reference at the top of the .ascx file to reference "AACustomProductImage.ascx.cs"
- Any changes to EITHER the AACustomProductImage.ascx.cs or the ProductImage.ascx.cs have no affect on the AACustomProductImage.ascx file. I even tried deleting all the content in both these files and still, nothing changes - no errors.

Any suggestions? I'm sure it's something obvious but I running out of ideas.

Using Gold

Re: Unable to Edit code behind

Posted: Thu May 30, 2013 9:32 pm
by Naveed
You should also rename the class in both files and rebuild the page/project for changes to take effect.

Inside the AACustomProductImage.ascx.cs file rename the class:

Code: Select all

public partial class AACustomProductImage: System.Web.UI.UserControl
Inside the AACustomProductImage.ascx file update the Control inherits attribute in first line to match the class name.

AbleCommerce recommends to create your custom ConLib controls inside a "Custom" sub-folder under ConLib. If you move your control inside the Custom sub-folder, update the namespace as required. This is just a suggestion, not a requirement.

Re: Unable to Edit code behind

Posted: Fri May 31, 2013 3:02 am
by jmestep
If you are working on the WAP version, the changes won't take effect until you compile the solution. If you are using the WSP version, the changes will take effect with no additional steps required. We do our sites using the WSP version for this reason, even though we have all the tools (like Visual Studio) required for the WAP version. Here is some info on the differences:
http://help.ablecommerce.com/faqs/ablec ... d_wap_.htm

Re: Unable to Edit code behind

Posted: Mon Jun 10, 2013 8:18 am
by dmurphy4
I was able to convert from WAP to WSP and code behind works fine now. I had problems compiling the site. Probably because I started buiding the project as a Web Site and Not opening as a web application.

The below topic was helpful in converting the site to WSP. Thanks jmstep!
viewtopic.php?f=65&t=16831