Tagged articles

Found 33 articles tagged with MVC

Generic string to primitive type converter in C#
Converting string data to any primitive type in .NET and .NET Core
0
Often case when you need to convert String to a different type which is most of the time a primitive type in C# is when you are reading values from configuration. In both .NET and .NET Core, reading from configuration return plain String value... read more
Handling Cross-Site Scripting (XSS) in ASP.NET MVC
Handling XSS in ASP.NET MVC with custom Razor Html helpers and HttpModule
 
0
Cross-site Scripting (XSS) refers to client-site code injection attack where an attacker can execute malicious scripts into a web application. Basically attacker manages to upload malicious script code to the website which will be later on served to the users and executed in their browser. It is ofter use to steal form inputs, cookie values, change the page layout or redirect to attackers website. ... read more
Reasons for ASP.NET application restarts on IIS server
Common reasons for causing ASP.NET web applications to restart
0
If you were experiencing you ASP.NET Web Application to restart, there are few possible reasons for that, but before we jump to resons why ASP.NET web application hosted on IIS gets restarted let's first look at the relation between IIS and ASP.NET ... read more
QR code MVC html helper
Display runtime generated QR code in MVC page
0
This article is based on one of my previous topic Advanced Base64 image extension in ASP.NET MVC. It uses the same concept to display image on the page and to cache it, but it involves QR code bitmap generation which is basically a NuGet package use. Basically, QR code is generated using NuGet package QRCoder https://www.nuget.org/packages/QRCoder/ and result Bitmap is serialized to base64 string and cached so we do not regenerate same QR bitmap over and over on every request which may lead to server overload. ... read more
Advanced Base64 image extension in ASP.NET MVC
Advanced base64 image rendering in a Razor in ASP.NET MVC
0
Serializing images to base64 string is well known technique to reduce requests per page. Each image on the page produces a separate request while page is loading... read more
ASP.NET Core Web API versioning
Simple way to setup versioning in ASP.NET Core WebAPI
 
0
When it comes to WebAPI many project overlook the versioning aspect. The whole concept of WebAPI is to serve multiple types of clients which can be based on different platforms, run on different devices etc... read more
Inline JavaScript and CSS tags with ASP.NET MVC
Rendering inline JavaScript and CSS tags in document in MVC
 
0
With ASP.NET MVC Microsoft introduced bundling of JavaScript and CSS resources. These bundles work pretty well but to me it always looks not so natural to define bundles in BundleConfig.css and I had problems if I want to edit CSS or JavaScript during runtime because they are cached. One more thing I was struggling with is injecting the script inside the document instead of referencing the script or css from an external file. ... read more
Why is JsonRequestBehavior needed?
Understanding JSON data restriction over HTTP GET requests
0
You probably run to this exception when you tried to fetch JSON data over HTTP GET request. Now, first this is easy to bypass by simply adding JsonRequestBehavior.AllowGet option to method which is retutning JSON data for GET request in a controller file. ... read more
Simple Office365 authentication
Use Office365 account login for your application
0
With so many online and cloud based services, adding one more additional account for your application adds additional complexity level for your users since they will have to manage one more account and remember one more password. Microsft ASP.NET comes with pretty nice built in provides for social networks, but for office usage social networks are not so convenient to be used. ... read more
IP address filtering from C# code in ASP.NET MVC and Web Api
Restrict or allow specific IP addresses to access your WebApi or MVC
 
0
Last year I wrote an article about IP address filtering on MVC and WebApi Restrict Access to an MVC Action or Controller based on IP address. Over time the requirements for IP filtering in several web based application increased, so I had t work on this class to make it more extendible and reusable in different scenarios. The new scenarios I wanted to cover are: ... read more

.NET

read more

JavaScript

read more

SQL/T-SQL

read more

Umbraco CMS

read more