NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: osquiabro on April 01, 2016, 06:46:30 AM

Title: p_web._SendFile Question
Post by: osquiabro on April 01, 2016, 06:46:30 AM
trying to redirect in login according user role with p web.SendFile example:

CASE p_web.GetSessionLevel()
OF  1
    p_web._SendFile('IndexPage',0)
OF  2
    p_web._SendFile('PageForActiveTransactions',0)       
OF  3
     p_web._SendFile('PageForSalesCustomer',0)
ELSE
    p_web._SendFile('IndexPage',0)
END

but NET:SendHeader in webhandler is always (1) value and can't change with  p_web._SendFile('IndexPage',0)

Title: Re: p_web._SendFile Question
Post by: MyBrainIsFull on April 03, 2016, 09:22:26 PM
Try this

Case
 of 1;  p_web.Script( p_web.WindowOpen( 'IndexPage' ))
 of 2;  p_web.Script( p_web.WindowOpen( 'CustomerPage' ))


and if you want to change the theme for different users

  of 3
      p_web.ChangeTheme( 'Shoestrap' )
      p_web.Script( p_web.WindowOpen( 'NiceUserPage' ))     
Title: Re: p_web._SendFile Question
Post by: Ubaidullah on October 27, 2020, 07:12:46 AM
Thanks for this. This was helpful for me today.
I used it and it worked nicely.

For anyone wondering where this code goes, it goes in LoginForm after the call to p_web.ValidateLogin and the code that sets the cookies.

Regards,
Ubaidullah Nubar.