Category: ASP

Adding Quartz to your ASP.NET Core

This is a ready made example of how to add a scheduled job to your ASP.NET core web application:

In your Program.cs

Continue Reading

How to use - (dash) in the ASP.NET MVC call?

ActionName attribute can be used:

 

Continue Reading

Footer from database in MVC ASP.NET

I've been struggling for a while to find a sensible way of getting the footer. Well... This is where partial views come useful. There are several ways to solve this problem. I've created a controller:

In the Shared folder I've added _FooterPartial.cshtml and in the layout this line:

It worked so awesome.

Continue Reading

Razor with JavaScript

Today I had a problem of adding markers onto a google map. I didn't really want to create a service to handle the request and return an array. So instead I tried doing something simpler.

This obviously didn't work. Razor was getting confused; it didn't know which one was the script and which one

Continue Reading

MVC File Upload - Access to the path is denied

An interesting problem occurred yesterday when I was trying to upload a file to the server. I was getting: Access to the path '' is denied The problem wasn't actually caused by the file upload but by my attempt to create a directory to put that file there. After reading a bunch of answers on

Continue Reading

How to display an image on the website from a binary source (e.g. a database)

There are various ways in which one could display an image on the website form a binary source. One solution would invole simply converting the binary source into a base64 and put it as the src of the image:

However, this is not acceptable if you load images 'on demand' i.e. when the user

Continue Reading