razor Questions
6
Solved
Given the following Razor code:
<tbody>
@foreach (Profession profession in Model)
{
<tr>
<td>@profession.Name</td>
<td>@profession.PluralName</td>
<td&...
Dichotomize asked 28/10, 2011 at 9:44
3
Solved
I have a table in my db where one of the properties is an Html page (without the html, head and body tags), and I intend to put it in the middle of one of my views - say, I call a cotroller method ...
Irrelative asked 25/1, 2011 at 20:14
2
The command dotnet build for a razor page app with .net-6.0 throws lots of warnings like
CSC : warning RSG002: TargetPath not specified for additional file:
C:\dev\Foo\Foo\Pages\Admin\Administrat...
Epiphyte asked 22/10, 2022 at 9:0
5
In visual studio 2010 markup in MVC3 and ASPX pages was collapsible (by closing tag) however it does not seem to be working in visual studio 2012. Anyone know how to get it working? I cant find it ...
Scopophilia asked 16/1, 2013 at 15:24
6
Solved
I found a thread: Highlighting kills my Razor syntax in Visual Studio 2010 ,
asking and explaining how to turn off the highlighting for Razors code.
The problem is, I navigate to: Tools -> Opti...
Allegraallegretto asked 9/2, 2015 at 6:54
7
The following code:
View:(is-valid)
<div class="form-group">
@Html.LabelFor(m => m.Telefone, new { @class = "font-weight-bold" })
@Html.TextBoxFor(m => m.Telefone, new { @class = "f...
Pauiie asked 27/1, 2018 at 16:14
5
I'm trying to style body, header and form tags in my ASP.NET Web App using Razor Pages, CSS Isolation. Styles created in scoped CSS file (_Layout.cshtml.css) for some HTML tags are not working. The...
Elsaelsbeth asked 24/3, 2022 at 19:3
12
The project was running fine until I updated all NuGet packages via
NuGet Manager (I was trying to get the latest OWIN packages).
This error is in the _Layout.cshtml and I have not touched it at al...
Naarah asked 13/5, 2015 at 15:53
2
I am working on an app that lets users search our database. When a user enters search terms, the app hits an API endpoint, and returns the data. I then display the data.
When the API returns the da...
10
Solved
I am trying to show bootstrap modal then bind its buttons. But I cannot pass the first step showing the modal. I am using Blazor client template of .net core 3.1. I have a page named Modal.razor wh...
Comyns asked 9/12, 2019 at 21:19
4
Anyone have a good solution for formatting Razor files inside of VSCode? I've tried making it work with prettify-vscode and beautify. But in both cases it can't tell that cshtml files. I don't want...
Bradytelic asked 12/1, 2018 at 23:33
4
Solved
I know it's possible to set breakpoints in a MVC Razor view but something got wrong and it's not working anymore..
I tried to restart visual studio 2013 and to change some options of Debugging. Ha...
Skell asked 15/10, 2014 at 16:8
8
I am having this frustrating problem. I change text in a razor view (cshtml), Start without Debugging, refresh (Ctrl+F5) the browser but nothing happens. The strange part is that if I modify a cont...
Peachy asked 29/1, 2016 at 13:9
2
Solved
I am using master layout of Razor MVC that have something like this
@RenderSection("scripts", required: false)
And have partival view
_partial.cshtml
That have this
@section scripts
{
@Scri...
Pleomorphism asked 4/12, 2014 at 9:42
11
Solved
I have a datatable that I'm converting into a List, serializing it and passing it to my view using a viewmodel.
My viewmodel looks like this:
public class AddressModel
{
public string Addresses ...
Achene asked 27/8, 2013 at 16:16
8
Solved
I have a Textbox with type as date. I am trying to set default value of the textbox to current date.
@Html.TextBoxFor(x => x.Date, new { @id = "Date", @type = "date",
@value = DateTime.Now.To...
Hypopituitarism asked 17/10, 2014 at 4:54
11
Solved
I am making an ASP.NET MVC application with the razor engine.
And I was wondering if it's possible to use Regions in a view.
something like:
#region blabla
<p>@Model.Name</p>
<p&...
Gignac asked 22/3, 2011 at 14:37
5
Solved
I have a Blazor app and a Razor library.
In my Razor library, I have a component, AccountNavigation.razor that i am able to use with html syntax and it works correctly, like so: <AccountNavigat...
Perutz asked 29/9, 2019 at 4:26
7
Solved
I'm trying to learn Claims for MVC 5 OWIN login. I try'ed to keep it as simple as possible. I started with the MVC template and inserted my claims code (see below). I get an error when I use the @H...
Epicurus asked 22/6, 2015 at 9:54
10
Solved
I'm new to the C# MVC project type and when I created an empty C# MVC project, I noticed the following error:
The view 'Index' or its master was not found or no view engine supports the searched l...
Him asked 8/8, 2014 at 18:28
11
Solved
I created a RazorFunctions.cshtml file on App_Code
@functions {
public static string GetActiveClassIf(string controllerName, string actionName = null)
{
var routeData = @HttpContext.Current.Req...
Pearliepearline asked 14/2, 2015 at 7:35
4
Solved
I have the following header of ASP.Net MVC page:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<NEOGOV_Ideas.Models.SubIdeaAdm...
Kaitlin asked 19/9, 2011 at 9:33
27
Solved
After significant refactoring in my MVC 4 application, and Razor shows this error while debugging Views:
The name 'model' does not exist in the current context.
This is the offending line of c...
Weltanschauung asked 31/10, 2013 at 1:38
2
Is there a way to do an extern alias inside a razor (MVC3) view?
I have two versions of the same assembly (i.e. 1.0 and 2.0) with a type that has the same name and namespace and I need a way to sp...
5
I have a List<> binded with some data in Controller action and I want to pass that List<> to View to bind with DataGrid in Razor View.
I am new to MVC.Can any one help me how to pass and how...
Piece asked 12/6, 2012 at 10:28
1 Next >
© 2022 - 2025 — McMap. All rights reserved.