I've got a Blazor Server-Side application. It has the folders Pages and Shared out-of-the-box. Since I have a lot of components in these folders, I wanted to distribute the components into multiple subfolders for a clearer structure. But if I do this, the components are not found and are not displayed in the GUI. What am I missing? Do I have to register the routes to the new subfolders somewhere?
Folders help you keep your files organized and separate. If you had no folders on your computer, your documents, programs, and operating system files would all be located in the same place. Folders also allow you to have more than one file with the same file name. For instance, you can have a file called Resume.
Answer. Answer: is that subfolder is (computing) a folder within another folder while folder is (computing) a virtual container in a computer's file system, in which files and other folders may be stored the files and subfolders in a folder are usually related.
Simply hold down the Shift key and click with the right mouse button in the Explorer on the folder where you want to create additional subfolders.
You can have whatever folder structure you wish. But you will need to update your _Imports.razor
with the new namespaces.
For example if you have a structure of
MyProject/Components/Forms/MyInput.razor
You would need the following in your _Imports.razor
:
@using MyProject.Components.Forms;
The other option is to reference components using their fully qualified namespace:
<MyProject.Components.Forms.MyInput/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With