on 05-29-2007 3:07 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, that was what I needed!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.