You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe the problem.
Hi,
right now I have to declare ViewComponent using TagHelper like this:
<vc:my-component some-option="sample1" some-option2="sample2"></vc:my-component>
public async Task<IViewComponentResult> InvokeAsync(string someOption, string someOption2)
Describe the solution you'd like
<vc:my-component some-option="sample1" some-option2="sample2"></vc:my-component>
[ViewComponent(Name = "MyComponent")]
public class MyViewComponent : ViewComponent
{
public string SomeOption { get; set; }
public string SomeOption2 { get; set; }
public async Task<IViewComponentResult> InvokeAsync()
{
//SomeOption..
}
Additional context
My described solution is actually taken from ASP WebForms, it was clear and could be used outside method. Right now we have to pass variable to private methods.
Bonus of WebPart solution is that you dont have to provide all attributes/properties in HTML. It will use default values. Appending new parameter requires change at all locations if there is no default value, if you are not implementing model around it as single parameter.
Apologies if there is already duplicate.. I tried to search, probably mixed up keywords :)
The text was updated successfully, but these errors were encountered:
Thanks for contacting us.
While this may be a great idea, it is not aligned with our long-term vision to make it part of the framework. For many other ideas which don't belong to the framework we encourage the community to build and ship on their own, contributing to the expanding .NET Ecosystem.
You can learn more about our triage process and how we handle issues by reading our Triage Process writeup.
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
Hi,
right now I have to declare ViewComponent using TagHelper like this:
Describe the solution you'd like
Additional context
My described solution is actually taken from ASP WebForms, it was clear and could be used outside method. Right now we have to pass variable to private methods.
Bonus of WebPart solution is that you dont have to provide all attributes/properties in HTML. It will use default values. Appending new parameter requires change at all locations if there is no default value, if you are not implementing model around it as single parameter.
Apologies if there is already duplicate.. I tried to search, probably mixed up keywords :)
The text was updated successfully, but these errors were encountered: