Dynamicweb 8 Documentation
GetCartFormName Method
Example 

Gets the name of the cart form.
Syntax
'Declaration
 
Public Function GetCartFormName() As String
public string GetCartFormName()

Return Value

"CartForm_[ID]"
Example
class MyPage : System.Web.UI.Page
{
   public void RenderOrder(Order order, Template template, Dynamicweb.Frontend.PageView pageView)
   {
       // New form to replace the quantity form to also include orderline fields
       if (order.StepNum < 2)
       {
          if (pageView != null)
          {
             int pageID = pageView.Page.ID;
             template.SetTag("Ecom:Order:CartForm.Start", string.Format("<form action=\"/Default.aspx\" name=\"{0}\" method=\"POST\">", order.GetCartFormName()));
             template.SetTag("Ecom:Order:CartForm.End", "</form>");
             template.SetTag("Ecom:Order:CartForm.Name", order.GetCartFormName());
             template.SetTag("Ecom:Order:CartForm.SubmitUpdate", string.Format("javascript:document.{0}.action = '/Default.aspx?ID={1}&step=1'; document.{0}.submit();", order.GetCartFormName(), pageView.Page.ID));
             template.SetTag("Ecom:Order:CartForm.SubmitOrder", string.Format("javascript:document.{0}.action = '/Default.aspx?ID={1}&step=2'; document.{0}.submit();", order.GetCartFormName(), pageView.Page.ID));
          }
      }
   }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Order Class
Order Members

Send Feedback