Questions tagged as 'asp.net-mvc'

2
answers

What's the difference between @ Url.Content ("~ / css / bootstrap.css") and only "/css/bootstrap.css"

I'm learning to program an application based on MVC4 and Bootstrap. Right at the beginning of the project I came across a puzzle: In _Layout.cshtml I had <link href="css/bootstrap.css" rel="stylesheet"> , Bootstrap worked fine i...
asked by 12.12.2016 / 19:09
3
answers

Angular + ASP.NET MVC: Makes sense?

I'm starting to study Angular2. As I'm working a lot with .NET I've decided to do a project with ASP.NET MVC 4 and Angular2. Reading the hello world of the Angular I noticed that the Angular has its own route mechanism, which would in a w...
asked by 10.02.2017 / 03:20
1
answer

How to pass parameter to MVC controller

How to pass text or index from a DropDownList to Controller at the press of a button? I tried using @model and could not. I tried by adding [HttpPost] to Controller and using the submit button and it...
asked by 19.01.2017 / 19:11
5
answers

Do not allow to record duplicate registrations

I'm developing a system using ASP.Net MVC and Entity Framework. How do I not allow equal data to be written to a table? For example, do not allow login: x to be registered more than once.     
asked by 05.05.2014 / 14:19
2
answers

Return xml to asp.net mvc browser view

I have the following situation, I need to make an XML file available to be viewed in browser , without the user having to download the file, I do this by saving the file in a directory and then I send the directory of this file and the browse...
asked by 10.04.2017 / 22:25
2
answers

Validation of two fields with jQuery.validate and DataAnnotations

Good afternoon guys, Next, I need to validate if one of two fields is filled, I tried to create an Attribute function with ValidationAttribute but it did not validate correctly, I think jQuery.validate does not recognize it. Follow the cod...
asked by 14.09.2016 / 19:15
2
answers

Referencing folders created in the project

After I go to Project > Add > New Folder, rename the folder and put classes inside it I can no longer reference it in another file, for example if it were to be used in a controller , I would use as always I used the using nomeProjeto.N...
asked by 21.12.2015 / 14:08
2
answers

How to update all records of all tables that have FK from a table

I have the following tables: CREATE TABLE Contrato ( [Id [int] NOT NULL IDENTITY, [Nome] [varchar](150), [Ativo] [bit] PRIMARY KEY ([Id]) ) CREATE TABLE [dbo].[ItemContrato] ( [Id] [int] NOT NULL IDENTITY, [ContratoId] [int], [No...
asked by 25.08.2017 / 20:51
1
answer

Various Books for Author

Recently, I asked a question about my problem, but it was kind of difficult to understand, here I will try to summarize my problem. I'm using ASP.NET MVC. I have 2 tables: Autores and Livros , where 1 Autor has many...
asked by 04.12.2015 / 13:08
2
answers

Referencing class Syntax Razor C #

I have a class where I have saved a configuration key being key and value, however I need to get the value of that key and pass it to my cshtml page. I'm having trouble with this. I've already passed the class path, but I can not refer...
asked by 21.07.2016 / 14:33