4 Replies - 3161 Views - Last Post: 16 June 2018 - 06:14 AM Rate Topic: -----

#1 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14691
  • View blog
  • Posts: 58,720
  • Joined: 12-June 08

Core 2 - Razor pages - custom controls / partial views..

Posted 14 June 2018 - 12:20 PM

Sanity check with Core 2 and Razor pages (not MVC) I am not finding the ability to create custom, reusable, controls or even fiddle with partial views to make something similar.

Is that an accurate statement?
Is This A Good Question/Topic? 0
  • +

Replies To: Core 2 - Razor pages - custom controls / partial views..

#2 andrewsw   User is offline

  • dependency injected
  • member icon

Reputation: 6668
  • View blog
  • Posts: 27,308
  • Joined: 12-December 12

Re: Core 2 - Razor pages - custom controls / partial views..

Posted 15 June 2018 - 10:00 AM

Controls are not integrated as they were with ASP.NET Classic/WebForms.

You can step towards jQuery UI or some Bootstrap controls; I even think Angular has some controls if you are working in that direction.

There are many UI libraries available. We use Kendo. Using its grid does, in my opinion, tie you to a certain look and behaviour. The charts are good. I have charts within partial views so, to an extent, they are 'customised'. It is stated that Kendo marries with Bootstrap but, in my opinion, it is a trial to get them to work together. Kendo, and probably others, are tied to jQuery.

There are other libraries...
Was This Post Helpful? 0
  • +
  • -

#3 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14691
  • View blog
  • Posts: 58,720
  • Joined: 12-June 08

Re: Core 2 - Razor pages - custom controls / partial views..

Posted 15 June 2018 - 12:00 PM

That's what I thought.

I kicked the idea around and what was asked for was custom controls, I would create, that would be swappable and semi dynamic. MVC sort of had a way with 'partial views', but that no longer looks to be the case with Razor.

Off to go report the bad news for someone's request.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14691
  • View blog
  • Posts: 58,720
  • Joined: 12-June 08

Re: Core 2 - Razor pages - custom controls / partial views..

Posted 15 June 2018 - 04:15 PM

Going down the rabbit hole for 'tag helpers'. This smells like it may work, but it has to hit my key points first.

We'll see what happens over the weekend... this may end up being a tutorial if it works.
Was This Post Helpful? 0
  • +
  • -

#5 andrewsw   User is offline

  • dependency injected
  • member icon

Reputation: 6668
  • View blog
  • Posts: 27,308
  • Joined: 12-December 12

Re: Core 2 - Razor pages - custom controls / partial views..

Posted 16 June 2018 - 06:14 AM

There are ViewComponents as well, probably some combination will get you where you need to be.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1