-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New components or functions for development #18537
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
Comments
Thanks for contacting us. |
Thank you @javiercn for #18851 and #18979 and @mkArtakMSFT for your feedback. |
Hi, I'll try to address each of your points in order. For A I don't think this is a common enough request to be part of the framework itself. We are considering including a redirect component, but that is still under consideration. You can also achieve this in many ways:
For B, this already exists as For E, the same answer as A applies. Simply hide your UI by default using CSS and enable it once you are ready. All these things you can build on top of Blazor and we don't plan to bake them in unless we see evidence that they are common enough to require a solution provided by within the framework and not by some other library built on top. |
Thank you @javiercn. 😄 I will follow your recommendations. |
We believe all the aspects here have already been covered. If there is something left, please file a new issue with individual issues please. |
Here are some features I would like for Blazor. This would facilitate the implementation of a website.
What do you think?
A. Have the possibility to define a startup page
For example, the main screen/dashboard has the
@page '/'
.The login page has the
@page "/login"
.When the application starts, the applications loads first the "login" page
because it is defined as the startup page.
B. Method to check the Uri
To avoid a malicious attack on a redirection from the login page,
it is required to check if the returnUrl (used for the redirection after a successful login)
belongs to the list of possible Uris of the routing table.
Is there a function for it?
It could just return a boolean value if the Uri is matching or not in the routing table.
C. NotFound component
Could a 'NotFound' component be provided in a Blazor toolkit.
Inputs could be the URL for the navigation and a render fragment.
Render fragment is used to display a message to the user if the user is authenticated.
In the other case, there a redirection to another page. Example: Login
Below is an example what could be achieved by this component.
D. RedirectToLogin component
Could a 'RedirectToLogin' component be provided in a Blazor toolkit.
Inputs could be the URL for the navigation and a render fragment.
Below is an example what could be achieved by this component.
E. Hide option
The application starts at the '/'.
During the loading/startup of the application on the web browser,
the nav menu in the 'MainLayout.razor' is shown during a very short period (blinking).
Then there is a redirection to the login page which is using another layout.
Is it possible to 'hide' completely (or stops totally the rendering) of the layout, so the 'MainLayout' layout is not shown at all during the startup? Could a specific attribute do that implementation?
Below is the following app.razor.
Below is the workaround. The nav menu is not shown at all during the startup.
Is there a better solution?
Below is the layout used by the Login page.
Further technical details
ASP.NET Core version 3.1.
Microsoft Edge 81.0.396.0
It's a Blazor Web Assembly with ASP.NET core hosted.
Visual Studio 16.5.0 Preview 2.0.
The text was updated successfully, but these errors were encountered: