aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Custom index.html for Blazor

Open majorimi opened this issue 8 years ago • 5 comments

Is there any way to use a custom "index.html"? If not, is it on the road-map?

Because I think it would be great because adding a custom index.html for your project could open the possibility to:

  • Target a DOM element for Blazor code, like Angular, React... So part of the page could be static HTML and some DIV would be replaced with the rendered application. (I think it require some change in Blazor to accept the Id of the element)
  • Customizable "Loading page", instead of the currently used simple "Loading..." message. (It should work out of the box).

majorimi avatar Jun 14 '18 12:06 majorimi

If you want to replace "loading..." with something, you can put whatever html you want inside the tag. Am I missing something?

dlr1 avatar Jun 14 '18 13:06 dlr1

@majorimi The index.html file is in the wwwroot directory and you can edit it freely to add your own customisations.

SteveSandersonMS avatar Jun 14 '18 13:06 SteveSandersonMS

Sorry guys my fault... I'm totally new to Blazor, just started using ASP.NET Core and the whole wwwroot folder concept is kind of new to me. I noticed the "index.html" in "\bin\Debug\netstandard2.0\dist" folder new the the "_framework" folder with all the runtime stuff and thought it was generated by the compiler. But I was wrong. Replaced the loading text with an image. Works perfectly....

Thanks.

majorimi avatar Jun 14 '18 15:06 majorimi

No problem @majorimi! It takes a while for anyone to get familiar with a new technology.

SteveSandersonMS avatar Jun 14 '18 15:06 SteveSandersonMS

For someone who used MVC/Razor before it is very easy to get use to it. Even the promise to get rid of the JavaScript (or at least hide it from the developer) sound awesome! This is the biggest thing since .NET Framework was introduced!! I hope the Blazor will be production ready soon.

Thanks and keep up the good work guys 👍

majorimi avatar Jun 14 '18 15:06 majorimi