code locations general question

kyle shapiro asked on April 2, 2015 00:57

Hello everyone. Soon I will begin creating new webparts in visual studio and wanted to get started on the right foot. I was investigating the datalist webpart code at C:\inetpub\wwwroot\Kentico82\CMS\CMSWebParts\Viewers\Documents\cmsdatalist.ascx. This webpart creates a HTML table structure with a certain number of columns depending on what is selected for that particular field. I can not find the code responsible for creating these tables within cmsdatalist.ascx. Is it found in one of the "using namespaces"? I'm a novice with C# and .net development. I would really appreciate if somebody could point me to the location of the code responsible for generating this HTML table. I feel it's important to understand this before I begin creating webparts or editing existing ones. I have worked through the "hello world" webpart tutorial once before, but even that wasn't crystal clear.

Recent Answers

Brenden Kehren answered on April 2, 2015 01:01

The majority of the controls referenced in the webparts are compiled Kentico controls. If you need or want to modify the output of a control (repeater, datalist, etc.) this can typically be done with a transformation. Many times you don't need to modify any of the for the webparts, the majority of you work can be done within the Kentico UI.

1 votesVote for this answer Mark as a Correct answer

Charles Matvchuk answered on April 2, 2015 03:02

It sounds like you want to create some custom web parts. I would recommend going through some tutorials on C# first and then .Net stack, etc. As Brenden indicated the majority of existing web controls are compiled and you cannot edit their code unless you have source code which is included in a version of the licensing. You can however use the existing controls in new controls .ascx (web parts) that you develop. This will deal with inheritance, etc. Of course you can create your own custom controls from scratch. Just pay attention to the inheritance and different events that each web control needs to subscribe to.

If you want some frank advice, I would suggest that open up visual studio, find some tutorials on creating .ascx controls and go through them. Then drop them on your own, .aspx pages. Once you got that down, then there is not much difference in using them in Kentico.

1 votesVote for this answer Mark as a Correct answer

kyle shapiro answered on April 2, 2015 15:06

I thought that particular code might have been something precompiled. Thank you both very much. I truly appreciate the advice and information.

0 votesVote for this answer Mark as a Correct answer

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