Display Shipping Address on PaymentPage.ascx
Posted: Thu Aug 04, 2011 5:11 pm
I am having difficulty displaying the customers shipping address on the PaymentPage.ascx.
On PaymentPage.ascx I have:
And in the Page_PreRender function on PaymentPage.ascx.cs I have:
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!
On PaymentPage.ascx I have:
Code: Select all
<asp:Literal ID="FormattedShippingAddress" runat="server" EnableViewState="false"></asp:Literal>
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);
}
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!