Questions tagged as 'asp.net-mvc'

3
answers

Session limitation for saving data

I have a slow query in Oracle to list all accesses for a user, so I thought of writing the result to a Session , the average of records returned is 600, with%? Would you have any other better way to save this data?     
asked by 30.09.2015 / 21:29
4
answers

How to notify Api Web user with SignalR?

When I receive a post in an application Web Api I need to notify a certain client that a new record has been entered. This user will see this notification in a separate client application ( javascript ) of the Web Api...
asked by 29.09.2014 / 05:04
4
answers

Converting HttpPostedFileBase to byte []: Exception_WasThrown

Follow the code below: Controller (with post action): var file = Request.Files[0]; var bytes = ConvertTo.Bytes(file); ConvertTo Class: public static byte[] Bytes(HttpPostedFileBase result) { var length = result.InputStream.Leng...
asked by 12.10.2017 / 17:50
1
answer

How could I improve the code for this paging control?

I mounted a paging control for a blog that I'm putting together, but I'm not sure if I did it the best way, I tried to copy the paging control of Stack Exchange sites. Could you guys take a look and tell me what you think? A screenshot of h...
asked by 23.11.2015 / 02:10
3
answers

How to make a POST that passes beyond the form, a file?

My question is this: I can move to the controller OR the file OR the form. I was wondering if there is any type (same FormCollection, however this apparently only gets the form itself, the files posted together does not) that it receives both th...
asked by 24.07.2014 / 18:53
1
answer

Web API and Owin OAuth - redirect to another domain (redirect_uri)

Good afternoon, I'm having a problem implementing external login in a project I'm working on.    ASP.NET Web API + Owin + OAuth. Environment: I work with two Server1 and Server2 servers. Server1: Server published on the WEB. It hos...
asked by 09.05.2016 / 22:01
2
answers

C # MVC Asp .NET Paging

I have a performance problem in paging with Entity Framework and SQL SERVER, first it does getAll to later list paging var bdPergunta = new PerguntaRepositorioEF(contexto); var pergunta = bdPergunta.GetAll().OrderByDescending(x => x....
asked by 29.07.2015 / 15:41
1
answer

How to know if path exists?

One of my system classes is created with information from a file. When you start the system, it initially runs the following lines: public List<Estabelecimento> listaEstabelecimento(string ibge) { List<Estabelecimento> lista...
asked by 05.10.2017 / 17:03
2
answers

Where to put Data Annotation? View Model or Model?

Using Entity Framework Code First, with view model and model . To create a column with varchar(2) , I need to put MaxLength(2) in model and view model ?     
asked by 28.08.2015 / 21:32
3
answers

How to send 2 Controller objects to the View in C # ASP.Net MVC?

I made a query in the database in 2 tables and saved in 2 objects in the controller , but I can only send 1 object to view . // Controller // Pego os dados do BD e salvo no objeto var objPessoa = new PessoaAplic(); var dadosPessoa = objPesso...
asked by 06.10.2015 / 21:22