Form control in web part

giridhar Addagalla asked on December 20, 2018 12:34

Hi I have created a custom for form control, where i need to add that in the web part, is there any way to add it in custom web part.

Recent Answers


Peter Mogilnitski answered on December 20, 2018 14:02

It is the same principle, register custom tag and use it.

0 votesVote for this answer Mark as a Correct answer

giridhar Addagalla answered on December 21, 2018 04:49

what will be the name space then, after creating a custom code for the form control i added it in the kentico form control and try to use that in the web part, but where the solution you have provided will not work that way. it is to add through the code file.

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on December 21, 2018 22:56

Should be somehting like this:

      <%@ Control Language="C#" AutoEventWireup="true" Inherits="CMSWebParts_custom_custom"  Codebehind="~/CMSWebParts/custom/custom.ascx.cs" %>
<%@ Register Src="~/CMSFormControls/Inputs/customFormoControl.ascx" TagPrefix="custom" TagName="MyCustomControl" %>
0 votesVote for this answer Mark as a Correct answer

giridhar Addagalla answered on December 26, 2018 11:35 (last edited on December 26, 2018 11:38)

I am developing my form control in this way https://docs.kentico.com/k11/custom-development/developing-form-controls/example-developing-custom-form-controls and it should be displayed in web part in live site, is there any reference for this, the above reference is only for the form control in code type but here in the documentation it is first written in code and later added in form control to the admin panel and the form control should be used in the web part.

0 votesVote for this answer Mark as a Correct answer

Kathleen Nardella answered on January 7, 2019 02:58

I'm assuming that you are asking how to use your new form control as part of a web part configuration? In the "Form controls" admin panel, make sure that you have "Controls and web parts" checked in the "Control scope" > "Show control in" section. Then, in the "Web parts" admin panel, when you are configuring the Properties of your web part, you should see your form control in the "Form control" drop down. If you still don't see it, make sure that the "Data type" of the web part field is one of the allowed data types ("Control scope" > "Use control for") in the "From control" admin.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.