-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace constructor #261
Comments
Hello @MadsCastle7, Blazor until .NET 9 don't support constructor injection. You can try using InjectAttribute. Please send any info here if this is not what you meant. |
the above didn't work . so instead of trying to use JJMasterdata directly in Blazor, i've created an API project and added a route in there. The code below successfully returns the form I have then added an HttpPost route to try and save the contents, however GetFormValuesAsync() is always empty. I'm guessing that i need a handle to the form id? Can you offer any advice? |
Can you share the complete snippet of your |
You need to send the form values at your Post request, because without the form values the |
I am trying to get a form displayed in a Blazor web site. I don't need a mobile version that you pointed out was a problem before.
However, in Blazor I cannot instantiate the object in a constructor as Blazor will not allow this and gives an error when trying to add the class as a singleton in Program.cs
Is it therefore possible to do something like:
IComponentFactory c = new ComponentFactory();
As it stands it appears that the protection level on the class will not allow this.
The text was updated successfully, but these errors were encountered: