Questions tagged as 'asp.net-mvc'

1
answer

How to do a complex query in SQL in .NET MVC

I would like to know how to make a query, using multiple fields, multiple tables with inner joins in ASP.NET MVC without having to put the SQL string in the code, using the Entity Framework. Currently, without using the string in the code, I...
asked by 19.06.2014 / 19:47
2
answers

How to make a user helper logged in Asp.NET MVC 4?

I need to implement a Helper for logged in user, ie a static class that returns information about the logged in user of context . The idea is to use information in both Controllers and Views .     
asked by 22.05.2014 / 00:38
2
answers

Inserting special character in view

I have an HTML table where one of your td needs to enter the following information: <td>@item.OrderSend º</td> I wanted to insert this way: <td>@item.OrderSendº</td> But when you join the º character with...
asked by 11.05.2017 / 14:26
3
answers

Format a string with time

I'm trying to format a string that already has date and time, but this string just has to get the time I'm trying in this way more does not work: > Recovering from the database. string dtSolicitacao = String.IsNullOrEmpty(Convert.ToStri...
asked by 27.08.2015 / 14:01
2
answers

get return from procedure sql c #

I need to get the return of a select that comes from a procedure . I've seen about using ExecuteReader , but I'm not getting the data that's coming. procedure is up to date Since the return of procedure will...
asked by 16.03.2018 / 18:13
2
answers

Edit MVC with Foreign Key

I need to improve on my editLivros , then I'll explain my project. Autores ------- IdAutor Nome Livros -------- IdLivro Nome IdAutor I am registering the Authors and Books correctly, when I register the Livro , I make a View...
asked by 19.11.2015 / 19:04
3
answers

TempData ["Message"] error in the runtime saying that the object is null

I recently started with ASP.NET MVC, and as you can see I'm playing in the if statement, else the tempData[] and the one that happens is a following, every time I click inside the else in "View in Page Inspector" it gives me an error in t...
asked by 02.09.2014 / 17:09
3
answers

try / catch does not show correct message

Staff have a my C # code that has the code: Uri resultadoURL; bool resultado = Uri.TryCreate(Configuracoes.Configuracao.URL, UriKind.Absolute, out resultadoURL) && resultadoURL.Scheme == Uri.UriSchemeHttp; if (!resultado) throw ne...
asked by 13.08.2014 / 20:24
1
answer

How to call a View passing parameters through json

I have this code that passes parameters to my controller: var id = $(Musico).val(); var url = '@Url.Action("Votar","Chamada")'; var tipo = 1; $.ajax({ url: url, data: { id:id, tipo:tipo } }); My controller: public...
asked by 25.11.2016 / 02:55
1
answer

Returning the values of a model dynamically in .NET MVC

I have an authentication class that stores the user ID in a session, which receives the model name corresponding to the current user, such as users, admins, clients. Example: Authentication.Guard("users").Attempt(user.id) However, in thi...
asked by 28.06.2016 / 21:09