can i use custom table in page type kentico mvc project?

Muhammad Kaleem asked on March 5, 2019 11:13

please anyone can suggest how to use custom table in page type? also want to get data from custom table any help will be highly appreciated

Recent Answers


vasu yerramsetti answered on March 5, 2019 12:20 (last edited on March 5, 2019 12:22)

Custom table and Page Type both are different objects in Kentico. We can not use custom table in page Types.

Page Type VS Custom table refer the below URL:

https://docs.kentico.com/k12/developing-websites/defining-website-content-structure

Retrieving content on MVC sites

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 5, 2019 12:22

Hi,
It does not make much sense. Page type is a structured way of storing data, you can create the content tree. While custom table is just a table storage for data. Do you want to display some data form a custom table on pages? If yes, then use the API code to get the custom table data - you asked this in another thread and you got the answer how to retrieve custom table data and then work with these data in your MVC code to display them. You do not need page types for this. I would recommend taking the Kentico training to learn how things work.

0 votesVote for this answer Mark as a Correct answer

Muhammad Kaleem answered on March 5, 2019 13:26

i host my kentico mvc site to a domain and under the site node i add neww app for admin-panel/cms now my domain url is abc.com which is working fine and admin-panel url is abc.com/admin admin panel is also working but when i open page tab from content tree it says "HTTP Error 404.0 - Not Found" how should can i handle this issue?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 5, 2019 13:28

Please, start new threads for new questions. In this case, make sure you have the preview and page builder correctly configured, registered and implemented in your MVC code. See the documentation.

1 votesVote for this answer Mark as a Correct answer

Muhammad Kaleem answered on March 5, 2019 13:41 (last edited on March 5, 2019 13:50)

hi Juraj Ondrus thanks for the replying i have register page builder in app_start as

ApplicationBuilder builder = ApplicationBuilder.Current;

        builder.UsePreview();
        builder.UsePageBuilder();

        bui still facing same error, everything is working fine but unable to preview page in page tab
0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 5, 2019 14:16

OK, but how is the page builder enabled on your pages? Please, read the entire section in the documentation first. You need to create appropriate model, view and controller for that page. There is no auto-magic which creates the site for you.
Kentico MVC development model is based on content-only page types. Unlike Portal engine pages (utilizing the older ASP.NET Web Forms technology), content-only pages offer a much cleaner architecture. The content is separated from its presentation. Texts and page assets are held in a structured form in the content-only pages so that they could be worked on in a uniform way and presented in more than just one form. The way the texts and assets are presented (organized) in the web pages, is the responsibility of the MVC app. This means that you need to create and develop the front end MVC app with your custom code and logic.

0 votesVote for this answer Mark as a Correct answer

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