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 %>';

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

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

Here are the complete properties list: