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

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: Packt Publication: Like us on Facebook here:

DropDownList Helper Data Binding in MVC

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

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

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

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

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

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

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

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

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

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

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

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

Customize User's Profile in ASP.NET Identity System