Skip to Content

How do I tell if the customer is B2B or B2C

I'm wanting to create a "dealer" area on our website. A place where B2B customers can go to download special deals, pricelists, etc.

My idea was to put a link on the my account page to an asp page that I would build. On that page I need it to figure out if the customer in that session is B2B or not. If not, give them a "sorry" message, and redirect them back to the my account page.

If it's a dealer, it displays the page with all the dealer info.

Is there a way to do this in netpoint already? If so, how? If not, how do I tell if the customer is B2B or not in an asp page?

Thanks,

Jim

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 02:21 PM

    Hi Jim,

    To determine if a user is a B2B account or not you can use the API.

    So for example here is a skeleton you can use: (assuming you are using c#)

    <%@ Page Language="C#" inherits = "netpoint.classes.NPBasePage" %>
    <%@ Import Namespace = "netpoint.classes" %>
    <%@ Import Namespace = "netpoint.api.account" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
    
        protected void Page_Load(object sender, EventArgs e)
        {
            //check if this is a B2B user.
            NPBasePage p = (NPBasePage)Page;
            NPAccount acc = new NPAccount(p.AccountID);
            if (acc.AccountType == "B")
           {
                //its a B2B user
           } 
          else
          {
               //not a b2b user, redirect
               Response.Redirect("http://wherever you want to go to");
           }
           
           
        }
    
    
      
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
        </div>
        </form>
    </body>
    </html>
    

    hope that helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 29, 2007 at 02:53 PM

    Thanks, that was what I needed!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.