If you need to fetch data from a server while the user is viewing a webpage, you need to give the user an indication that the fetch is occurring and that the webpage is not frozen. Spinners are the perfect solution. You can show the user spinning circles, dots, bars, hearts and any other type […]
Example of a javascript fetch to a razor page
In this example, we have a database of tours with id, name, price, and other information. We would like to pull just the name and the price of the tour using a javascript fetch to a site hosting the razor pages. We will use the index page on the server site and assume it has […]
Excluding files and folders from your published .Net Core web project
You can exclude files or folders from your published .Net Core project by editing your project file. In Visual Studio, click on the project to open the projectName.csproj file. To exclude the file wwwroot\json\example.json, add the following. <ItemGroup> <Content Update="wwwroot\json\example.json" CopyToPublishDirectory="Never" /> </ItemGroup> To exclude all json files in that folder, add: <ItemGroup> […]
Making a Google map fit in a container
As a developer, adding a Google Map to a responsive page can be difficult because both the minimum width and minimum height have to be specified to make the map display. The best solution is to use “vw” units. 10vw will resolve to 10% of the current viewport width. For example : .themap {min-height: 120vw;min-width: […]
React example of forcing text to wrap under a photo
It can be difficult to get text to wrap under a photo, especially if the photo and text are in a flex box that just gets wider for longer text and you don’t know in advance how wide the photo will be. You want the flex box to stay the width of the photo. However, […]