Most voted "razor" questions
With ASP.NET Razor we have the possibility to insert the application logic directly into the project view layer, for example, it is possible to insert the Razor syntax along with the HTML codes within the same page
Learn more…370 questions
Sort by count of
-
0
votes1
answer105
viewsUse of unassigned local variable. How to resolve?
I’m developing a site that requests an api and shows the data to users, but I’m having problems: Use of unassigned local variable 'value' Use of unassigned local variable 'date' To better…
-
-1
votes1
answer888
viewsViewbag losing reference after sending form. Asp.Net MVC
Hello, I have two Viewbags that are storing a list each, I click them in a form to make a select box, along with them has a Remove button. So far so good, but when I click on the button of the first…
-
-1
votes1
answer205
viewsBootstrap/Razor Second panel makes Collapse in the first
What happens is that I have 2 topics in the database that are inserted automatically in the page and even here everything well, but starting with the panels closed or open if you click the second it…
-
-1
votes2
answers129
viewsI can’t call CSS
When I use @Html.Editorfor and call css, it doesn’t come in input when I run, even if I take out new { htmlAttributes } @Html.EditorFor(model => model.Usuario.MATRICULA, new { htmlAttributes =…
-
-1
votes1
answer10
viewsHow to return a compound field in a dropdown by ASP CORE using Razor
original in the model = ViewData["JobId"] = new SelectList(_context.Job, "JobId", "JobDay"); Together with Jobday, put the field Job.Entity.Entityname, Job and Entity are related and in context.…
-
-1
votes3
answers1898
viewsHow to call a Javascript Function inside a Razor?
I am programming in ASP.NET MVC and I have a registration form. I need to check if the date of birth is valid, ie if it is less than today’s date. I have the script but do not know how to call it…
-
-1
votes1
answer72
viewsHTML vs markup auxiliaries
Apparently HTML and markup helpers can perform the same functions, like this example I found in microsoft documentation: HTML auxiliaries @using (Html.BeginForm("Register", "Account",…
-
-1
votes1
answer470
viewsViewbag, passing controller value to Razor page
I have this Ajax to be able to take the data and pass to the function Save items that is in the Schedulesitenscontroller, that even works perfectly. function SalvarItens() { var idItem =…
-
-1
votes1
answer38
viewsDo not page the list of Products
I don’t know anything about Razor or Webmatrix. I took a project already done by another developer and I came across two problems, I can not locate where the SQL queries to list the products and…
-
-1
votes1
answer67
viewsProblem when correctly rendering a select HTML
I have the following tag select: <select asp-for="@Model.EstadosServicos" asp-items="Html.GetEnumSelectList<EstadoServico>()" id="tipo" class="form-control"></select> that creates…
-
-1
votes1
answer67
viewsHow to bring in Razor a Dropdown with the element already selected from a database?
I created a register where an object has n elements and each of them is selected from a Dropdown, the registration works perfectly but when I edit the Dropdowns do not show the selected item…
-
-1
votes1
answer17
viewsHTML validation der Jquery mask
Guys I have an ASP.NET MVC screen using Razor, which in Edit return data that has already been saved for editing. In one of my fields is of type (decimal) use to save monetary value. This field when…
-
-1
votes1
answer20
viewsLayout Logo breaks when exiting Index
Hello, my logo breaks after leaving the index, whatever the view(Edit,delet, etc.), it breaks, in the index is normal, I would like to know how to fix it, following the error and the code. I’m using…
-
-1
votes1
answer32
viewsComponentization of fabrics
I have a web project in .NET Framework 4.6.1 and with Angularjs 1.2.29. Currently it perfectly serves our customers in Brazil. The point is that the product has evolved, and now we are going to…
asp.net-mvc angularjs razor internationalization globalizationasked 3 years, 10 months ago Jedaias Rodrigues 6,718 -
-2
votes1
answer232
viewsThe Viewdata item that has the key 'officeId' is of type 'System.String' but must be of type 'Ienumerable<Selectlistitem>'
Controller: public ActionResult Cadastrar() { ViewBag.officelist = new SelectList(new OfficeREP().ListarTodos(), "id", "estado" ); [HttpPost] [ValidateAntiForgeryToken] public ActionResult…
-
-2
votes2
answers615
viewsHow to put a dropdownlist in a cshtml
I need to place a dropdownlist under the following conditions: It will display the name of the City(City Table), but will only record the Employee Code. Using this approach, I can assemble the…
-
-2
votes2
answers65
viewsI’m trying to do a research boot on my view, but tell me it can’t be null
I’m trying to make a search button on mine view of films, but gives me a mistake to say that I can’t have a zero value. Why? And what do I have to do? Controller: public ActionResult Index(string…
-
-2
votes1
answer151
viewsFill inputs as option selection
Hello! I have this View where I update the value and quantity of a product in the Database by selecting it in Viewbag, works perfectly. I populate this Viewbag as follows in Controller:…
-
-4
votes1
answer1594
viewsPut mask to @Html.Editorfor
In the database, the CPF field is bigint and long in the model. I have two problems with this: 1) If Cpf starts with 0 or 00, it will not record this and then, to display on screen, I will have to…
-
-7
votes1
answer166
viewsEdit MVC . NET error
I have an error when I edit my registration, my Physical Model is like PartialView,the following error occurs: Attaching an entity of type 'Projeto.Models.Fisica' failed because another entity of…