How to pass two parameters to inline control

   —   
Inline controls allow more than one parameter. This article shows you the sample of BizForm inline control. We will add the second parameter called Alternative form and will make it work.
1. Find this file:
<web site folder>\CMSModules\Bizforms\InlineControls\BizFormControl.ascx.cs

2. Add this code of new property to line about 32:
/// <summary>
/// Alternative form name
/// </summary>
public string AlternativeForm
{
get
{
return ValidationHelper.GetString(this.GetValue("AlternativeForm"), null);
}
set
{
this.SetValue("AlternativeForm", value);
this.Bizform1.AlternativeFormFullName = "BizForm." + this.FormName + '.' + value;
}
}

3. Place this code inside the SetupControl() method:
this.Bizform1.AlternativeFormFullName = "BizForm." + this.FormName + '.' + this.AlternativeForm;

4. Go to Site manager -> Inline controls -> edit BizForm -> Properties and add new property:

Attribute name: AlternativeForm
Attribute type: Text
Attribute size: 50
Allow empty value: checked
Display attribute in the editing form: unchecked


and save it.

5. Place the inline control code to your Editable region. The format is following:
{ ^inline_control_name|(attribute_name)value|(attribute_name)value^}
If you have a Form called “ContactUs” and an Alternative form with “xx” code name the specification of BizForm inline control looks like:

{ ^BizFormControl|(FormName)ContactUs|(AlternativeForm)xx^}


See also: Alternative approach

Applies to: Kentico CMS 4.1
Share this article on   LinkedIn

Juraj Ondrus

Hi, I am the Technical support leader at Kentico. I'm here to help you use Kentico and get as much as possible out of it.