Page 1 of 1

Display Shipping Address on PaymentPage.ascx

Posted: Thu Aug 04, 2011 5:11 pm
by dave@givemore.com
I am having difficulty displaying the customers shipping address on the PaymentPage.ascx.

On PaymentPage.ascx I have:

Code: Select all

<asp:Literal ID="FormattedShippingAddress" runat="server" EnableViewState="false"></asp:Literal>
And in the Page_PreRender function on PaymentPage.ascx.cs I have:

Code: Select all

User user = Token.Instance.User;
Address shippingAddress = null;

foreach (Address tempAddress in user.Addresses) if (tempAddress.Nickname == "Shipping") shippingAddress = tempAddress;

if (shippingAddress != null)
{
	FormattedShippingAddress.Text = shippingAddress.ToString(true);
}
Which I feel like should work, but I am getting the error:
error CS0103: The name 'FormattedShippingAddress' does not exist in the current context


I have tried to declare 'FormattedShippingAddress' in other locations on the PaymentPage.ascx.cs but have had no luck.

Please help.

Thanks!

Re: Display Shipping Address on PaymentPage.ascx

Posted: Tue Aug 09, 2011 7:40 am
by plugables
This is strange. I suspect that files being edited are different from the files being compiled.

Re: Display Shipping Address on PaymentPage.ascx

Posted: Wed Aug 10, 2011 3:47 pm
by dave@givemore.com
Thanks for the reply Plugables.

How could I determine if the files being compiled are different from the files I edited?

Also, is there a way to force a compile of the two new files?

I encounter this error a lot and it would almost have to be something like this.

Thanks!
Joe

Re: Display Shipping Address on PaymentPage.ascx

Posted: Tue Aug 16, 2011 6:16 am
by plugables
Do you have multiple copies of PaymentPage.ascx in your store?
Are you editing the default files that are in ConLib folder?
Can you post the code from PaymentPage.ascx and PaymentPage.ascx.cs?