Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to hide prices if user not logged in to webtools


Our client has a requirement whereby he would like to hide the prices in the partdetail if a user is not logged into the site.

Once they have logged in they can then view the prices in the part list and part detail sections.

Could someone please advise on how to achieve this?

Thanks you



Former Member
Former Member replied


try something like this

for partlistpage:

add this to partlistblock.ascx and change for this colunm with price only.

protected override void OnPreRender(EventArgs e)
              string userID = ((NPBasePage)Page).UserID;
            if (userID != "") {
             PartsListGrid.Columns[7].Visible = true;
             PartsListGrid.Columns[8].Visible = true;
            } else {
             PartsListGrid.Columns[7].Visible = false;
             PartsListGrid.Columns[8].Visible = false;
             PartsListGrid.Columns[9].Visible = false;
             PartsListGrid.Columns[10].Visible = false;

for part details page i suggest in catalogpartdetail.master

    private void Page_Load(object sender, System.EventArgs e) {
            string userID = ((NPBasePage)Page).UserID; 
            if (userID != "") {
                partprice.Visible = true;
            } else {
                partprice.Visible = false;

try the same with search page...

regards Greg.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question