Questions tagged as 'razor'

2
answers

IF condition within _Layout.cshtml in MVC

I have two _Shared.cshtml (MVC masterpage type, I do not know the name) and both are pretty much the same, only the left menu is different. I would like to do only 1 and according to the querystring I will call the page I want to be th...
asked by 13.05.2014 / 19:11
2
answers

CheckBoxListFor with error

   Description: An error occurred while compiling a resource needed to service this request. Examine the specific details of the error and modify the source code accordingly.       Compiler Error Message: CS1061: 'System.Web.Mvc.HtmlHelper' doe...
asked by 07.05.2014 / 19:05
1
answer

How to call column name from another class in the MVC WebGrid

I have this view Listar.cshtml @model IEnumerable<ODM> @{ var idGrid = "grid" + this.ViewBag.IdParameters ?? string.Empty; var grid = new IBM.Web.Helpers.WebGrid(id: idGrid, rowsPerPage: this.RowsPerPage, ajaxUpdateConta...
asked by 17.08.2015 / 21:55
1
answer

Error trying to pass a list of controller to view ASP NET MVC

Good morning, I'm new to development, and I'm having trouble passing a list of a controller query to a view. I gave a researched and all the forms I found did not help much, if anyone can help me, I'll be grateful. Follow the controller:...
asked by 20.08.2015 / 13:22
1
answer

VallidationSummary shows no error on the screen

I am using ValidationSummary in forms, but they are not being rendered. Is there any known reason for this error? Example form: @using (Html.BeginForm("CadastrarPessoaFisica", "Usuario", FormMethod.Post)) { @Html.ValidationSummary(false...
asked by 07.09.2014 / 22:32
1
answer

How to render 2 typed view of different controllers

How do I render 2 typed view of different controllers ? Controller: public ActionResult Index() { Cliente cli = new Cliente(); cli.Nome = "Al Unser"; return View(cli); } Index: @model MvcRazor.E...
asked by 20.08.2016 / 04:17
1
answer

Passing information to a Modal

I have this routine using Razor from C #. It lists my messages: Code: @for (int i = 0; i < 3; i++) { <div class="box-body" style="line-height:15px"> <ul class=" products-list prod...
asked by 25.08.2016 / 21:32
1
answer

Error Opening System.InvalidOperationException database?

I'm using webMatrix, to develop an example in JqueryMobile, I'm having the following error @{ Layout="~/shared/_Layout.cshtml"; Page.Title = "Home"; Page.Header = "Categorias"; var db = Database.Open("Northwind40.sdf"); va...
asked by 20.05.2015 / 22:46
2
answers

DisplayNameFor and DisplayFor

Studying ASP.NET MVC, I came across the following lines of code: @Html.DisplayNameFor(model => model.Title) @Html.DisplayFor(model => model.Title) I can not understand the difference between using DisplayNameFor and DisplayF...
asked by 08.08.2017 / 19:21
2
answers

Script to make a div appear

I have a user registry in my application, when I click on register I wanted to display a message. This whole treatment I'm already doing and playing the message in my ViewBag.Message. How do I show this DIV by clicking the register button?     
asked by 11.08.2015 / 14:29