Bookmark and Share

Wednesday, November 10, 2010

HOWTO use DNN properties inside a ascx SKIN

If you need to use inside a DotNetNuke skin ascx file the user email or the username or other information you can write this code:

<%= UserController.GetCurrentUserInfo().email %>

If you need it inside Javascript you can define this code:

<script language="javascript">
var GlobalUserEmail = '<%= UserController.GetCurrentUserInfo().email %>';
</script>

And use it in you js code, using the command:

if (typeof GlobalUserEmail!="undefined")
//your code here

Here are the complete properties list:

http://www.dotnetnukeru.com/dnndocs/api/html/T_DotNetNuke_Entities_Users_UserInfo.htm

image

No comments:

Post a Comment