Top "Razor" questions

Razor is a template language used by ASP.

DropDownList in MVC 4 with Razor

I'm trying to create a DropDownList on a razor view. Would someone help me with this? Normal HTML5 code: <…

c# asp.net-mvc razor
ASP.NET MVC get textbox input value

I have a textbox input and some radio buttons. For example my textbox input HTML looks like that: <input …

c# html asp.net-mvc asp.net-mvc-4 razor
HTML.ActionLink vs Url.Action in ASP.NET Razor

Is there any difference between HTML.ActionLink vs Url.Action or they are just two ways of doing the same …

asp.net-mvc asp.net-mvc-3 razor
How to get current page URL in MVC 3

I am using the Facebook comments plugin on a blog I am building. It has some FBXML tags that are …

c# asp.net asp.net-mvc razor
Using Razor within JavaScript

Is it possible or is there a workaround to use Razor syntax within JavaScript that is in a view (cshtml)? …

javascript asp.net-mvc razor
How to write "Html.BeginForm" in Razor

If I write like this: form action="Images" method="post" enctype="multipart/form-data" it works. But in Razor with '@…

forms asp.net-mvc-3 razor
Html.DropdownListFor selected value not being set

How can I set the selected value of a Html.DropDownListFor? I've been having a look online and have seen …

asp.net-mvc razor
How to declare a local variable in Razor?

I am developing a web application in asp.net mvc 3. I am very new to it. In a view using …

c# .net asp.net-mvc asp.net-mvc-3 razor
Populating a razor dropdownlist from a List<object> in MVC

I have a model: public class DbUserRole { public int UserRoleId { get; set; } public string UserRole { get; set; } } public class DbUserRoles { …

c# asp.net-mvc-4 razor html.dropdownlistfor
Pass parameter to controller from @Html.ActionLink MVC 4

In this line: @Html.ActionLink("Reply", "BlogReplyCommentAdd", "Blog", new { blogPostId = blogPostId, replyblogPostmodel = Model, captchaValid = Model.AddNewComment.DisplayCaptcha }) I get the …

razor asp.net-mvc-4