cancel
Showing results for 
Search instead for 
Did you mean: 

How do I tell if the customer is B2B or B2C

0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

0 Kudos

Thanks, that was what I needed!

Former Member
0 Kudos

Hi Jim,

you are most welcome.

Regards,

Stephen