bitScry - Blog

MVC

About this site

This is a blog to help me remember some of the coding challenges I’ve faced and hopefully help others out if they’re suffering the same problems.

Recent Posts
  • Adding a Sonoff Zigbee Dongle Plus P Router to Zigbee2MQTT
  • Configuring Raspberry Pi 5 with NVME Hat
  • Pass Through an iGPU to Frigate from Proxmox
  • Creating a Frigate VM on Proxmox
  • Enable Remote Root SSH Login
Tag Cloud

.NET .NET Core AAD API appsettings.json ASP.NET Core Authentication Authorization Azure Azure Active Directory Azure Function Azure Storage Blob Bootstrap C# Cloud Storage Console Application CSS CSV DataTable Dependency Injection Dictionary Docker Entity Framework Enum Extension HTML Image JavaScript jQuery JSON List MVC Newtonsoft Raspberry Pi RestSharp Serilog SQL Stored Procedure Stream Table Table Storage Web App Web Application WordPress

Copyright
Creative Commons License Any code within by is licensed under a Creative Commons Attribution 4.0 International License.
Programming

Escaping the @ Symbol in an MVC View

I’ve been working with OData recently and one thing that briefly stumped me was that the property names begin with @ and in an MVC view the @ symbol is used to indicate C# code so when I tried to reference a property in JavaScript the page then thought I Read more…

By Shinigami, 5 years ago
Programming

Generating URLs in an MVC Page

If you want to generate URLs for use in an MVC webpage for actions in your controller then the UrlHelper Action method is pretty handy. This can be embedded into your cshtml page and will generate a URL at runtime for the specified action which will be relative to where Read more…

By Shinigami, 6 years ago
Programming

Passing URL Parameters Through A Razor Page

While trying to take the URL parameters from a page view and append them to an API call from a Razor web page in an MVC web application I kept on getting the URI encoded version of the ampersand from Context.Request.QueryString rather than the raw one that’s needed to separate Read more…

By Shinigami, 7 years ago
Programming

Complex objects in Session and TempData Variables

Session and TempData variables can be used in MVC controllers to pass variables between actions or from actions to views, however if you want to pass complex objects through using these variables the base classes need to be extended to serialize/deserialize the provided objects to/from JSON. Once the above classes Read more…

By Shinigami, 7 years ago
Programming

Bootstrap 4 Contact Form with Google reCaptcha

I’ve just started building a site using Bootstrap 4 which is different enough to Bootstrap 3 that I’m having to relearn a few things. One of those is form validation as previously I used bootstrap-validator though this doesn’t yet work with version 4. Version 4 does have it’s own inbuilt Read more…

By Shinigami, 7 years ago
Programming

Uploading Files in ASP.NET Core from an MVC View

I’ve been working on creating a page for for the uploading of files to either a SQL database or Azure Blob storage which turned out to be much more complicated than initially expected. I managed to eventually piece together how to do this and the resulting demo project can be Read more…

By Shinigami, 7 years ago
Programming

Returning HTTP Status Codes from ASP.NET Core Methods

Sometimes in an MVC controller you just want to return a HTTP status code from a method rather than a view or data object. This is pretty simple but is done slightly differently in .NET Core than it was done previously. Some of the more common status codes such as Read more…

By Shinigami, 7 years ago
Programming

Posting Data to an MVC Controller With jQuery

The easiest way to post data from a view to a controller action is by adding a form and submit button and letting most of the hard stuff happen automatically. Unfortunately this doesn’t really work in cases where data needs to be submitted by a javascript function, in these situations Read more…

By Shinigami, 8 years ago
Programming

Select List Enum Tag Helper

If you want to have a select list in a web page which is based on all the values in an enum then you can use the built in function “Html.GetEnumSelectList” with a tag helper.

By Shinigami, 8 years ago
  • About
  • Blog
  • Contact
  • Create your website with blocks
  • Sample Page
  • Sample Page
Hestia | Developed by ThemeIsle