Questions tagged as 'asp.net-mvc'

2
answers

Display dynamic images using Razor

Hello, I'm having trouble displaying dynamic images using Razor syntax in an ASP.NET MVC 5 project. I have the image path saved in a column in the database, named Image . Below the code for my view: @foreach (var item in Model) { <d...
asked by 29.12.2014 / 00:22
2
answers

How to do a Code First migration without deleting data from the table attribute?

I need to change the name of the Weight attribute to Product Weight , this is the code that is generated after running the add-migration command: namespace Web.Dominio.Migrations { using System; using System.Data.Entity.Migrations...
asked by 30.10.2016 / 20:09
2
answers

Query Entity Framework with Inner Join and Where

I am making a query using inner join of some tables and a where with only one condition, but the data is not returned in EF, the same query in Mysql works and returns data. Follow the code: string raAluno = acr.getAlunoLogado().ToString();...
asked by 21.05.2016 / 05:45
2
answers

Query with related data in the Entity Framework

I'm trying to get data from the materials with the data of your relationships with the tables Unit and TD, but this code below does not return anything, if I do without Include () it returns the data but with the relationship does not bring any...
asked by 20.08.2014 / 16:33
2
answers

Print Queries

I have a view in my application in asp.net mvc that allows the user to perform a search, which returns the name and data of that search. I wish I could print this search result. How do I print div or table? My view: <div> @using...
asked by 23.06.2014 / 16:22
2
answers

Format string in View

Is there any way to format a string (returned from a query) directly into View , to display the first letter of the letter and the lower case? Ex: In C # I can use the TextInfo.ToTitleCase for this. string title = "war and peace"; Tex...
asked by 04.02.2015 / 19:21
2
answers

How to use Resources in .js file?

I have an Asp.Net MVC project where I am using Resources , and to use it on my web pages p> @using projeto.Translations <h3>@Resources.DISPLAY_OLA</h3> The problem is that I have some items (buttons, for example) that are d...
asked by 24.07.2015 / 13:26
1
answer

Sending complex objects via HttpGet

I have a search method in my WebApi, as it is a search, I used [HttpGet] , as a parameter of this method, I pass an object with the filter options I want, for example: public class ParametrosBusca { public string nome { get; set; }...
asked by 13.07.2017 / 14:40
1
answer

Doubt with SQL injection

I have an internal method that is called based on another query, it is this way down. I would like to know if this would be a "string.Format" error, if it would be possible to send a SQL injection? public BuscaProdutosDermaClubeEntity ProdutoD...
asked by 13.06.2017 / 05:00
1
answer

Doubts about routes JS angular x ASP.NET MVC

I would like to remedy some doubts about Angular JS vs. ASP.NET MVC. I created an empty ASP.NET MVC application that will work with WEB API, configured all my routes with AngularJS, created an html page and its controllers, all with angularJS...
asked by 23.11.2017 / 12:26