Uploading an image to a file using javascript and entity framework

You can use javascript to resize a photo before posting to entity framework. The following html is included in a form with the id “formdata” and adds bootstrap for formatting. Form Html   <div class="form-group">                 <label asp-for="Photo" class="control-label"></label>                 <label class="control-label">Upload a photo</label>                 <div class="col-md-10">                     <input type="file" name="Upload" id="Upload" onchange="loadImageFile();">                 </div>                  <div>                     <img id="my_photo" src="@src">                 </div> […]

Read More…

Using the .net core anchor tag helper with Razor Pages and areas

With Razor Pages, the anchor tag helper is used somewhat differently than with MVC. A typical anchor tag helper for MVC is: <a asp-controller="Home" asp-action="Products">Our Products</a> In this case, you specify the controller as the Home controller and the handler method in the controller as “Products”. Razor Page Model In the case of a Razor […]

Read More…