Hello everyone,
I´m trying to create a custom BizForm, which has a textbox PageTitle. Default value of this textbox has to be a title of concrete page, which contains the BizForm.
I´ve tryed it yet, but it does nothing...
1) I´ve cloned the BizForm webpart.
2) In folder CMSWebparts/BizForms i´ve copied bizform.ascx and bizform.ascx.cs and renamed it with specific name of cloned BizForm.
3)I opened the new c# file and into method OnContentLoad() i´ve added code same as http://devnet.kentico.com/Knowledge-Base/BizForms/Setting-default-values-for-BizForm.aspx
4)I´ve edited the code like this:
Control ctrl = BizFormNew.BasicForm.FindControl("PageTitle");
//You should specify 'Column name' attribute from 'CMSDesk -> Tools -> Biz form -> Edit appropriate BizForm -> Fields -> select appropriate field' as parameter for FindControl method.
if ((ctrl != null) && (ctrl is TextBox))
{
((TextBox)ctrl).Text = page.Title;
}
What is bad? Thank you for quick answers!
Phil