Questions tagged as 'c#'

2
answers

Concurrent client side and server side requests

When using Ajax, I create an asynchronous request for my server. If I use N ajax requests simultaneously, am I still handling these requests synchronously on the server? If yes, to create an asynchronous request on both the client-side and th...
asked by 30.07.2014 / 20:24
1
answer

Appcache in Asp.net MVC

I need to use the html5 appcache to store some web pages. Before using MVC I simply made this regular expression to check whether it is connected or not. var offlinePages = /^\/(index|about|schedule|location).htm$/; And in this loop I test:...
asked by 15.08.2014 / 16:17
1
answer

Create DataTable Dynamically

I need to create a dynamic DataTable of the genre: List<p> =... List<l>=.... DataTable dt = new DataTable(); foreach (Prod pr in p) { dt.Columns.Add(prod.Nome.Trim()); for (int i = 0; i < l.Count; i++) {...
asked by 17.04.2014 / 17:08
2
answers

Form in the view with sub-forms in partialView

Dear friends, I have a view that contains only @model Projeto.Models.Oc and a form . Within this form , I have buttons that call MODAL , these MODAL have partialView , @model Projeto.Models.Rc , etc. I wanted to...
asked by 07.04.2014 / 15:12
1
answer

Reapping the HttpClient and life cycle of an ApiController

Based on on this site and also on I came to the conclusion that I should not use the class HttpClient in a using block even though it implements IDisposable . This would help reuse the already instantiated object and bring...
asked by 17.12.2018 / 16:49
2
answers

How to instantiate primary key in another MVC class?

I have class Funcionario and Projeto . Both have their Id's. I want to create a class ProjetoFuncionario and would like to instantiate the primary key of the two in this class. How can I do it? namespace Exercicio1.Mo...
asked by 14.11.2014 / 14:46
1
answer

How do I get Html.LabelFor () to display an asterisk in required fields?

I want the required fields (properties with the Required attribute) to render with an asterisk indicating that it is a required field. public class Foo { [Required] public string Name { get; set; } } Html.LabelFor(o => o.Name) //...
asked by 14.12.2013 / 20:36
1
answer

Implement Text Approval Flow

I am developing a project where the user can publish texts, but before being posted on the site needs to be approved, something similar to the invitations of friendship of social networks where it is necessary to wait for approval of another per...
asked by 04.10.2014 / 01:53
1
answer

Show database image for each usercontrol

UserControl1 private string lastName; private string nnovo; public string LastName { get { return lastName; } set { lastName = value; label2.Text = value; } } public string Nn...
asked by 19.07.2014 / 00:47
1
answer

Use IPagedList with multiple results

I'm using the IPagedList to do results listing in my application. But I'm trying to solve a problem: When I have many results, going to the controller function to read the results of another page gets heavy. That is, when I am loading my View I...
asked by 03.07.2014 / 18:01