Monday, 16 April 2012

DotNetNuke Tokens

List of tokens:


[Portal:Currency] Currency String
[Portal:Description] Portal Description
[Portal:Email] Portal Admin Email
[Portal:FooterText] Portal Copyright Text
[Portal:HomeDirectory] Portal (relative) Path of Home Directory
[Portal:LogoFile] Portal Path to Logo file
[Portal:PortalName] Portal Name
[Portal:PortalAlias] Portal URL
[Portal:TimeZoneOffset] Difference in minutes between Portal default time and UTC

[User:DisplayName] User’s Display Name
[User:Email] User’s Email Address
[User:FirstName] User’s First Name
[User:FullName] [deprecated]
[User:LastName] User’s Last Name
[User:Username] User’s Login User Name

[Membership:Approved] Is User Approved?
[Membership:CreatedDate] User Signup Date
[Membership:IsOnline] Is User Currently Online?

[Profile:<Property>] Use any default or custom Property defined for user profiles as listed in Profile Property Definition section of Manage User Accounts. Please use non-localized Property titles only.

[Tab:Description] Page Description Text for Search Engine
[Tab:EndDate] Page Display Until Date
[Tab:FullUrl] Page Full URL
[Tab:IconFile] Page Relative Path to Icon file
[Tab:KeyWords] Page Keywords for Search Engine
[Tab:PageHeadText] Page Header Text
[Tab:StartDate] Page Display from Date
[Tab:TabName] Page Name
[Tab:TabPath] Page Relative Path
[Tab:Title] Page Title (Window Title)
[Tab:URL] Page URL

[Module:Description] Module Definition Description
[Module:EndDate] Module Display Until Date
[Module:Footer] Module Footer Text
[Module:FriendlyName] Module Definition Name
[Module:Header] Module Header Text
[Module:HelpUrl] Module Help URL
[Module:IconFile] Module Path to Icon File
[Module:ModuleTitle] Module Title
[Module:PaneName] Module Name of Pane where UDT resides
[Module:StartDate] Module Display from Date

[DateTime:Now] Current Date and Time
[Ticks:Now] CPU Tick Count for Current Second
[Ticks:Today] CPU Tick Count since Midnight
[Ticks:TicksPerDay] CPU Ticks per Day (for calculations)

Friday, 13 April 2012

Backup MSSQL Database To External Path

It is very popular question from my clients. They have web access only to MS SQL database, but have to backup it to the external path. Ok, it can be done easy:

  1. At the external server/computer make a folder, for example "C:\External_Backup".
  2. Then go to the properties of this folder, tab "Sharing". Make public share with name "External_Backup" and add permissions for "Everyone" and "ANONYMOUS LOGON". Do not worry - its for few mins only, then we disable it.
  3. Temporary disable Firewall.
  4. Try to connect to this share from the Explore in this way "\\your_ip\External_Backup". You can see files and peform any actions in this folder.
  5. In the web client of MSSQL database run query like this: BACKUP DATABASE your_db_name TO DISK = '\\your_ip\External_Backup\your_db_name.bak';
  6. Enable Firewall and remove share from the public access.

Wednesday, 9 November 2011

Hover for IE

Hover for IE lt 9 works for links only. To fix this problem it needs to add few lines to the page:

Monday, 26 September 2011

Batch file with non-MSDOS coding

Sometimes it needs to run Batch file with non-MSDOS coding. Have spent a lot of time on it until found a way how to convert it. Just had to use Standard->WordPad, it allows to open file with any encoding and convert it to MSDOS encoding. Easy and fast.

Saturday, 21 May 2011

ModuleSettings and TabModuleSettings Difference in DotNetNuke

If you do not like to read preambula and want to know what is the difference between ModuleSettings and TabModuleSettings, then you can read it here.

Have been worked with it for a long time. Also asked a lot of DotNetNuke gurus, but they did not provide concrete answer about difference between ModuleSettings and TabModuleSettings. In generally it looks the same. For example, we have Settings.ascx. Inside we save some settings, for example Template. So our code should be like this:

Sunday, 8 May 2011

Create User Programmatically in DotNetNuke

One colleague asked about example on how to create user in DotNetNuke programmatically. Here is simple example on C# how to do this: