Razor Pages UserControl replacement
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
Razor pages do indeed support components, but they are for rendering views only. Developing modular applications and promoting reuse of interactive UI blocks is very hard with Razor Pages.
### Describe the solution you'd like
Please consider improving the support in View Components for dealing with events and postbacks. User controls in Webforms, allowed us to have blocks with full functionality and to deal with things so simple like a postback from a button click and on top of that, they could also be compiled, dynamically injected into a page and reused over and over.
Razor Pages need some kind of Components like UserControls or like Components in Blazor that can present data, deal with common interactivity and allow them to be reused by compiling them into a class library.
Without this, it's very hard to migrate from dynamic applications built on webforms.
Blazor has these features, but unfortunately, any minor changes to HTML code in already deployed .razor files always requires to recompile a project so it's not a viable solution for now in my point of view.
What is you opinion on this? Didn't you experience at some point this major gap? Here's a simple example:
How do you build a compiled, reusable component for newsletter subscription that receives an e-mail from the user and stores it into a DB with Razor Pages?
Thank you!
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.