Posts

Showing posts with the label Razor

Visual Studio 2015 Razor Syntax Highlighting and Intellisense not working

Today i faced this issue in my IDE and resolved with following steps:

I Am Now The Published Author of Instant Razor View Engine How-To

Image
I am happy to announce the release of my book ‘ Instant Razor View Engine How-To ’, published by PACKT; and now available at Amazon for purchase. Click on the image to enlarge. Amazon: http://www.amazon.com/dp/1849696306/?tag=packtpubli-20 Packt Publication: http://www.packtpub.com/razor-view-engine/book Like us on Facebook here: https://www.facebook.com/RazorViewEngine

DropDownList Helper Data Binding in MVC

Image
In this post you will learn how to bind data to a DropDownList helper in MVC. We will try binding data to a DropDownList from a List<SelectListItem>, a List<Model> and also from a database.

Adding metatags on .cshtml pages in MVC

Image
This quick post is a response to a question I received today on Facebook. Please follow the steps to add metatags on .cshtml pages:-

Strongly Typed Views in MVC

Image
When you add a new View in MVC, you get an opportunity to create it strongly typed. In the image given below, when you check ‘Create a strongly-typed view’ and select the ‘Model class’ you get following code snippet on the view page.

HTML Encoding in MVC

Image
One of the best feature in Razor view engine that I like most is ‘HTML Encoding’. In many cases (like a comment form on blog) we receive the data from users and he may be trying to victimize us by sending some malicious scripts causes cross-site script injection attacks (aka XSS attack).

Twitter RSS Feed Reader in MVC 4

Image
In this blog post you will learn how to setup the Twitter RSS Feed Reader in MVC 4. I’m using the same technique I used in my last post to read the Facebook feeds. Let’s look at the image that we will be creating using the given code.

Facebook RSS Feed Reader in MVC 4

Image
In this blog post you will learn how to setup the Facebook RSS Feed Reader in MVC 4. Let’s look at an image of what we will be creating in this post; see:

Adding Email, Details field in UserProfile DB Table in MVC

Image
In this post you will learn how to add Email and Details columns to an existing database. We get this database when running an application trying to create a new user account. As you know, we don’t see an email field in a user registration form as well as in the membership database. But we can enable this using some quick changes in the application. Read on.

Example on View to Controller (HttpPost) & warn on duplicate entry & delete duplicates in MVC

Image
This is a quick response post to the blog reader ‘V Patel’ who asked this question yesterday. Here is the question:

Filter Records in MVC

Image
In this quick post you will learn various ways to filter records in MVC. Before starting let’s have a quick look at a controller and view page that I will use in this article. I will be using the SQL Server Northwind sample database in this article, you can download it from the Microsoft website and set up the same project to explore it.

Partial View in Razor MVC

Image
Partial View allow us to put HTML and C# code into a file that we can reuse across multiple other views. This is very useful when you work on a large application.

Html Helper for Image (@Html.Image): Developing Extension in MVC

Image
Today I worked on a project where I required to display image on the web page. As you know there is not a Html Helper for Images yet. Look at the screen, we can’t see an image here.

Using image with HtmlHelpers or @Html.ActionLink

Image
Sometimes we need to serve image with the link and with the release of Razor syntaxes we have HtmlHelpers like Html.ActionLink() that has nothing like image.

Popular posts from this blog

Migrating database from ASP.NET Identity to ASP.NET Core Identity

Customize User's Profile in ASP.NET Identity System