This topic is locked

How to display user pic next to "Logged on as" message

11/13/2013 12:00:20 PM
ASPRunnerPro Tips and tricks
admin

Lets consider the situation when your login tables stores path to user picture. Sample database structure:

ID Username Password Pic

--------------------------

1 admin xxxx https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=21582&image=1&table=forumtopics

2 user xxxx https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=21582&image=2&table=forumtopics

...


Here is how you can display this picture as a part of 'Logged on as' message.

  1. In AfterSuccessfulLogin event save path to image file in session variable:

SESSION("pic")=data("Pic")



2. Then in BeforeDisplay event of the page where you need to display this picture use the following:

xt.assign "username","<img height=24x width=24px src='" & SESSION("pic") & "'> " & SESSION("UserName")


Modify width and height of the page accordingly. You will have to add this code to each BeforeDisplay event of those pages where you want to display this picture.