cancel
Showing results for 
Search instead for 
Did you mean: 

How to show the User Name on the Cart.aspx page when a user is connected.

Former Member
0 Kudos

Hi,

I am trying to find how I can get the User Name and display it in the top of the Cart.aspx.

For the diplay point of view, this is fine (I have created a <Literal> with a property ID, and specified it in the prerender.)

However, i can not find anywhere how to take the UserID from.

Do you know if there is a way to get this Data?

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I use something like this within the login control::


<%@ Import Namespace="netpoint.classes" %>
<%@ Import Namespace="netpoint.api.account" %>

 private NPBasePage _bp;

    protected void Page_Load(object sender, System.EventArgs e){
        bp = (NPBasePage)Page;
        NPUser u = new NPUser(bp.UserID);   
        Literal1.Text = u.FirstName + " " + u.Surname;
    }

Former Member
0 Kudos

Hi Yoann and Martin,

As a rule of thumb, when adding code to WT pages that have codebehind, use:


 protected override void OnPreRender(EventArgs e)

This way you can be fairly sure you will not bump heads with Webtool's page load

Former Member
0 Kudos

To achieve this without programming, you could put the banner plugin in the top slot and then use the %%UserName%% variable.