Latest in FAQs

You need to call ReloadData method of repeater after setting its properties in code-behind. You can also set 'DataBindByDefault' property of repeater (on aspx template) to false so the repeater won't bind data by default and will bind them only after you call ReloadData method.
Unfortunately, .NET supports only one form on the page and there is already one generated by Kentico CMS, but you can eventually put your custom HTML code for form into iframe placed on the page. You may also consider using
BizForms module.
When viewing your Form from CMS Desk -> Tools -> Forms, after you click edit on your form, you should see the data tab. You can find the option to export the form data by clicking Actions on the table header. This should bring up a pop-up with the export options listed.
-ag-
The main reason why this error occurs is renaming the database after installation of CMS or database malfunction caused by improper creation of it’s part. Recreating site using Web installer should solve the problem.
It could be tricky to resolve macros in a control’s parameters such as the
WhereConditon of nested repeaters in your transformation code because of inner apostrophes which can’t be avoided, so you need to use following exact syntax:
WhereCondition=<%# "<columnName>='" + CMS.CMSHelper.CMSContext.CurrentResolver.ResolveMacros("<macro>") + "'" %>
-jh-
This article is meant to discuss a few differences between using a single application pool and using multiple application pools in IIS. If you are looking for a more hands on approach for setting up your environment, you might want to take advantage of our paid consulting services
http://www.kentico.com/Support/Consulting/Overview, which can tailor a solution for your individual environment.
When using multiple application pools, you can dedicate an application pool to a single site. This will usually keep any problems isolated to one site, instead of spreading the issue across all sites located on the same machine. You can also use different ASP.NET versions on the same machine when using multiple application pools. This is because you can assign a different application pool for each version of ASP.NET. When using multiple application pools, you can use different Windows accounts on each application pool. This can not only enhance security, but it can also help when trying to track down performance issues.
Pros:
• Your sites will be isolated from each other. So if the application pool locks or has an error, it will only affect the single site.
• You can run different sites under different .NET versions.
• You can have unique settings for individual application pools.
• You can setup unique security features for each application pool.
Cons:
• Each application pool uses its own memory, which can use up a lot of resources on a single machine.
• It may also be harder to debug the site, since you are running multiple sites in one application pool.
While there are more Pros/Cons for each scenario, this should give you a general overview.
-eh-
You can reset the password directly in the database. Find the table named CMS_User and clear the password field for appropriate user name row. Then you can log in to the CMS using blank password and change it in the Administration section. If you store passwords in PLAIN text and not in SHA1 format, you can see appropriate password in table above directly.
Second option how to retrieve a lost password is to use the forgotten password link. Please go to some page which requires logon and click on mentioned link, enter you e-mail address and the new password will be send to this address (if it exists for some user account).
Firefox shows page fault problems often instead of loading Kentico CMS pages.
Applies to: Kentico CMS 2.x, 3.x
This is a common problem in Firefox when you use many tabs in Firefox, it swaps excessively to the disk and instead of loading tabs properly it shows page faults. You can avoid this problem using lower quantity of tabs or another browser only for developing purposes.
You can find list of supported browsers on our pages (
www.kentico.com/Download/System-Requirements.aspx).
To change customtable.oldname to customtable.newname:
First, rename the table using SQL Server Management Studio from “customtable_oldname” to “customtable_newname”.
Then, edit the custom table from
Site Manager -> Development -> Custom Tables and change the display name and the second part of the code name to newname.
Next, run the following SQL statement against your Kentico database:
UPDATE [CMS_Class]
SET [ClassTableName] = 'customtable_newname'
WHERE [ClassTableName] = 'customtable_oldname'
GO
Finally, edit the table from the Site Manager again and switch to the Queries tab. Update all of the queries to refer to the new table name.
-ag-
Please find sample code bellow:
EmailMessage msg = new CMS.EmailEngine.EmailMessage();
EmailTemplateInfo eti = EmailTemplateProvider.GetEmailTemplate("myTemplate", CMSContext.CurrentSiteID);
MacroResolver mcr = new MacroResolver();
mcr.SpecialMacros = new String[,] {{"#macro#", "text"}} ; //here you can specify text for multiple macros specified in template
msg.EmailFormat = EmailFormatEnum.Both;
msg.From = eti.TemplateFrom;
msg.Recipients = "name@domain.com";
msg.Subject = eti.TemplateSubject;
EmailSender.SendEmailWithTemplateText(CMSContext.CurrentSiteName, msg, eti, mcr, true );
Of course it is! You can refresh views easily via Kentico UI:
CMS Site Manager -> Development -> System Tables -> Views Tab -> Refresh All Views button
Navigate to the Site Manager -> Settings -> System section and look for the "Default user ID“ setting, usually this is set to number 53 (global administator). The corresponding user is used when inserting data via Import toolkit, you need to ensure this property is filled by the user ID of the user who exist in the target DB (where you import data to).
Import Toolkit
If you want to use another version of the jQuery library other than the default library used by the design mode in Kentico CMS, you would have to link it only on the live site, where the default jQuery library is not linked. You can achieve this by a simple context macro:
Visible property of a web part: { % PortalContext.ViewMode == "LiveSite" % }
Any text (e.g. head section of a master page):
{ % if (PortalContext.ViewMode=="LiveSite") { return "<script src='jQuery.js' type='text/javascript'>"; } % }
Some Kentico web parts will stop working if you use the standard jQuery linking in your custom web parts because they are using jQuery in some of their libraries. That’s why you need to use the jQuery noConflict version. Please check this link for more information:
http://docs.jquery.com/Using_jQuery_with_Other_Libraries
-bp-
For this purpose you can use following expression within your transformation:
<%# (CMS.CMSHelper.CMSContext.CurrentPageInfo.DocumentName.ToString() == Eval("MenuItemName").ToString() ? "curent page" : "not current") %>
It compares current document name with the value in the MenuItemName field. If they are equal the text after "?" sign is returned else you receive the text after ":". Please note it's only example, so you can adjust it to suit your needs.
You can use following sample code in Kentico CMS 4.0:
CMS.SiteProvider.UserInfo ui = CMS.SiteProvider.UserInfoProvider.AuthenticateUser(txtboxUsername.Text, txtboxPassword.Text, CMS.CMSHelper.CMSContext.CurrentSite.SiteName);
if (ui != null)
{
System.Web.Security.FormsAuthentication.SetAuthCookie(ui.UserName, true);
CMS.CMSHelper.CMSContext.SetCurrentUser(new CMS.CMSHelper.CurrentUserInfo(ui, true));
CMS.SiteProvider.UserInfoProvider.SetPreferredCultures(ui);
}
You may need a domain alias redirecting to the main site domain but keeping the domain with relative paths in the URL, for example: domainAlias.com/<any path> will display the content of siteDomainName.com/<the same path>. If so, you can set up the domain alias in Site manager -> Sites -> edit -> Domain aliases -> Redirect URL like: http://domainAlias.com{%relativepath%}.
This approach works since version 5.5 with the 5.5.14 hotfix.
-hg-
Even if you follow the
instructions for nested controls you can come up against a problem that it displays all documents under each item instead of the documents under the current item.
1. Please try to specify the path for the nested control like:
Path='<%# Eval("NodeAliasPath")+ "%" %>'
2. Set up the DelayedLoading and StopProcessing properties to true and add the code like:
<cc1:CMSRepeater DelayedLoading="true" StopProcessing="true" …
<script runat="server">
protected void Page_PreRender(object sender, EventArgs e)
{
repeaterId.StopProcessing = false;
repeaterId.ReloadData(true);
}
</script>
-hg-
If you want to add a new font into the drop-down list of fonts in the CK Editor, you need to add the definition of that font into the ckeditor.js file, which is located in the ~\CMSAdminControls\CKeditor\ directory. However, the content of the file is minimized so it is difficult to navigate there. The code where you can make changes to fonts is on line 57 and it looks like this:
i.font_names='New font/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif';
where the format of font definition is:
Title/Font style definition;
-jh-
You can also use following sample code to get data (DataSet) from custom table:
CMS.SiteProvider.CustomTableItemProvider tp = new
CMS.SiteProvider.CustomTableItemProvider(CMS.CMSHelper.CMSContext.CurrentUser);
DataSet ds = tp.GetItems("CustomTableCodeName", "whereCondition", "OrderBy");