Create user control template and use with custom web part

Vikash kumar asked on July 25, 2016 09:21

Hi All,

I have to create user control(.ascx) page template and use with custom or any web part.

Just wanted to know in Kentico 9 is it possible or not?

Recent Answers


Roman Hutnyk answered on July 25, 2016 10:02

Everything that was possible in version 8 is possible in version 9.

You can implement any suctom user control, register it as a web part and you on your page template.

1 votesVote for this answer Mark as a Correct answer

Vikash kumar answered on July 25, 2016 11:00

Hi Roman,

Thanks for your reply, I already know about registering template with web parts but just wanted to know can I register user control for particular page?

0 votesVote for this answer Mark as a Correct answer

Petar Kozjak answered on July 25, 2016 11:34

Hi,

did you try to add User Control web part? I think that is quickest way to add user control to a page....

0 votesVote for this answer Mark as a Correct answer

Vikash kumar answered on July 26, 2016 07:34

Hi ,

I need to use templated user controls: as like below :

https://msdn.microsoft.com/en-us/library/36574bf6.aspx

For this,I need to register the user control which acts like a placeholder and need to put the following code

<%@ Register TagPrefix="uc" tagname="TemplateTest" Src="TemplatedUC.ascx" %>

in the aspx page, but kentico donot have an aspx page instead we use user control webpart. How is it possible to register templated user controls in kentico.

0 votesVote for this answer Mark as a Correct answer

Vikash kumar answered on July 26, 2016 07:36

Hi ,

I need to use templated user controls: as like below :

https://msdn.microsoft.com/en-us/library/36574bf6.aspx

For this,I need to register the user control which acts like a placeholder and need to put the following code

<%@ Register TagPrefix="uc" tagname="TemplateTest" Src="TemplatedUC.ascx" %> in the aspx page, but kentico donot have an aspx page instead we use user control webpart. How is it possible to register templated user controls in kentico.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 26, 2016 15:00

Have you looked at the documentation on how to properly create an ASPX Tempate? If you do this you can easily use the approach you're talking about without issue.

0 votesVote for this answer Mark as a Correct answer

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