Dot Net Stuff

Preventing Cross-Site Request Forgery (XSRF/CSRF) Attacks in ASP.NET Core

CSRF attacks are possible against web sites that use cookies for authentication, because browsers send all relevant cookies to the destination web site. However, CSRF attacks are not limited to exploiting cookies. For example, Basic and Digest authentication are also vulnerable. After a user logs in with Basic or Digest authentication, the browser automatically sends the credentials until the session ends.

Continue Reading>>

Getting started with Razor Pages in ASP.NET Core

This tutorial teaches the basics of building an ASP.NET Core Razor Pages web app. We recommend you complete Introduction to Razor Pages before starting this tutorial. Razor Pages is the recommended way to build UI for web applications in ASP.NET Core.

Continue Reading>>

Introduction to Razor Pages in ASP.NET Core

Razor Pages is a new feature of ASP.NET Core MVC that makes coding page-focused scenarios easier and more productive. One of new features of ASP.NET Core 2.0 is support for Razor Pages. Yes, those same pages that came times ago with WebMatrix. Today Razor Pages is subset of MVC on ASP.NET Core. Yes, support for Razor Pages comes with ASP.NET Core MVC meaning that Razor Pages application is technically MVC application. Also Razor Pages have same features as MVC views.

Continue Reading>>

Creating Dynamic pages in ASP.Net MVC

In our real world of application development, sometimes we need to create dynamic pages in our application. In this article, we will learn about creating the dynamic pages in asp.net mvc. It is suggested to read MVC Url rewriting , if you haven’t idea about MVC Url rewriting or MVC Url Routing.

Continue Reading>>

ASP.NET MVC 4 Bundling and Minification - Performance Optimization

Bundling and minification of CSS and JavaScript is one of the most popluar and powerful feature of ASP.NET MVC. Bundling and minification reduces the number of HTTP Requests and payload size resulting in faster and better performing ASP.NET MVC Websites. There are a number of ways you can reduce and combine the size of CSS and JavaScript using the new feature, and in this ASP.NET MVC 4 Tutorial We will learn how you can create custom bundles where you specify the name and order of CSS and JavaScript Files. This method will work compatable with ASP.NET MVC 5 or lower version. While Bundling and minification of CSS and JavaScript in ASP.NET vNext can be achieved gruntjs. If you are looking for Bundling and minification of CSS and JavaScript in ASP.NET MVC 6, click here to read the article.

Continue Reading>>

Visual Studio 2015 Preview Comes with Emulator for Android, MVC6 and Entity Framework 7

Microsoft had launched Visual Studio 2015 Preview. Let try to know what's new in this release and point you more details. One of the other large announcements today is that we will open source the full server-side .NET core stack from ASP.NET 5 to the CLR and BCL and this version will run on Linux and MacOS X as well as Windows.

Since the majority of initial comments tend to be questions about supported configurations, I’ll put this up front: before you try to upgrade from Visual Studio "14" CTPs to Visual Studio 2015 Ultimate Preview, first uninstall Visual Studio "14" CTP – if you don’t, your system can wind up in an unstable state.

Continue Reading>>

AJAX Helpers in ASP.NET MVC Tutorials

Ajax helper of ASP.NET MVC essentially provides Ajax functionality to your web applications. AJAX Helpers are used to create AJAX enabled elements like as Ajax enabled forms and links which performs request asynchronously. Using Ajax helper you can submit your HTML form using Ajax so that instead of refreshing the entire web page only a part of it can be refreshed. Additionally, you can also render action links that allow you to invoke action methods using Ajax. AJAX Helpers are extension methods of AJAXHelper class which exist in System.Web.Mvc.Ajax namespace.

Continue Reading>>

How to Persist Data with TempData

TempData in Asp.Net MVC is one of the very useful feature. It is used to pass data from current request to subsequent request. In other words if we want to send data from one page to another page while redirection occurs, we can use TempData, but we need to do some consideration in code to achieve this feature in MVC. Because the life of TempData is very short and lies only till the target view is fully loaded. But, we can use Keep() method to persist data in TempData.

Continue Reading>>