Page 1 of 1

EditProductTemplate.aspx behavior changed in 7.03

Posted: Thu Jun 18, 2009 12:31 pm
by bigbangtech
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?

Re: EditProductTemplate.aspx behavior changed in 7.03

Posted: Thu Jun 18, 2009 7:34 pm
by Logan Rhodehamel
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.