EditProductTemplate.aspx behavior changed in 7.03

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
bigbangtech
Commander (CMDR)
Commander (CMDR)
Posts: 182
Joined: Mon Oct 10, 2005 6:27 pm

EditProductTemplate.aspx behavior changed in 7.03

Post by bigbangtech » Thu Jun 18, 2009 12:31 pm

I had added the following lines to Products/EditProductTemplate.aspx so I could jump to editing the template right away instead of having to navigate and hunt for the template in 7.02

Code: Select all

<a href="ProductTemplates/EditProductTemplate.aspx?ProductTemplateId=<%=_ProductTemplateId%>" target="_blank"><asp:Image ID="Image1" runat="server" SkinID="EditIcon" /></a>
After upgrading to 7.03 I get the following error:

Code: Select all

Compiler Error Message: CS0122: 'Admin_Products_EditProductTemplate._ProductTemplateId' is inaccessible due to its protection level
Being new to C#, I can't figure out how to properly pass the template id to the link in 7.03

Any suggestions?
AC7.3

Need A Bulb? - Light bulbs for the building maintenance and construction industries

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: EditProductTemplate.aspx behavior changed in 7.03

Post by Logan Rhodehamel » Thu Jun 18, 2009 7:34 pm

You are trying to access the _ProductTemplateId variable within EditProductTemplate.aspx.cs. This variable is listed as private, meaning other files can't get to it.

The proper way to fix this would be to add a public property into EditProductTemplate.asps.cs:

Code: Select all

public int ProductTemplateId
{
get { return _ProductTemplateId; }
}
Then in EditProductTemplate.aspx, refer to .ProductTemplateId rather than ._ProductTemplateId.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

Post Reply