Questions tagged as 'c#'

1
answer

Send a Bad Request via REST

My method takes the field value. If this field is null or zero, a Bad Request must be sent to the user indicating the field ID and informing that it can not be null. This is a REST service. I'm setting up the code (a foreach) and inside that for...
asked by 15.03.2018 / 22:37
1
answer

Progress Bar - How do you assume decimal values?

By learning, I'm creating a good beast in C # and I make a progress bar the life bar, but I need to decrease a decimal value and apparently progress only assumes int values. How can I make it display decimal values such as 99.2%? The Progress...
asked by 07.05.2018 / 23:56
1
answer

FileUpload is not passing the pro code file Behind

I'm doing some tests to upload any file and save it to a physical folder, but even with the file loaded on the screen, the same is not happening in ID / value: Example: Followingcodes:aspx:<divstyle="font-family: Arial">...
asked by 07.05.2018 / 15:50
2
answers

EF - Navigate through ICollection

I have the following class in a C # practice application with EntityFramework: public class Livro { public Livro() { Autor = new HashSet<Autor>(); } public int Id { get; set; } public string Titul...
asked by 15.03.2018 / 01:53
3
answers

How to pass a value from one method to another method within the same class? W#

I'd like to pass the tot variable that is in Cash Expense in float to the Show Expense method. Can anyone help me ?? class Ex4 { List<String> descricaodespesas = new List<string>(); List<float> valordespesas = new Lis...
asked by 14.03.2018 / 14:42
1
answer

Capture the IP and local machine name

I need to get the ip and local machine name of the client in case the user who will be accessing my system. My system is hosted on the system's network and database. The commands I've used so far I get the server name and server ip, but I nee...
asked by 14.03.2018 / 14:10
1
answer

How to make a data annotation validator based on another field?

I'm trying to implement a validator based on another field. My domain class. [Required] public string _tipoDeControle { get; set; } [NotMapped] public TipoDeControle TipoDeControle { get { return ExtensaoDeEnumerador.ObterEnumeradorPor...
asked by 15.03.2018 / 15:23
1
answer

Remove Dynamic Picturebox

I have an "Add" button which when clicked opens a screen for the user to select an image, that image is added to a flowLayoutPanel. A dynamic "Remove" button is added to the pictureBox, when that button is clicked the pictureBox should be remove...
asked by 08.03.2018 / 21:13
1
answer

Problems Posting in a ViewModel to the Controller - Asp.Net Core 2 MVC

I have a ViewModel that I use to load data from a physical or legal person. It contains some properties like PeopleNature, among others, that I use to load my dropdownlists from my view. The problem is right between my view and my Create method...
asked by 09.03.2018 / 10:31
1
answer

Modal boostrap in UpdatePanel after dark background click event

I have a modal boostrap poup within a ASPX UpdatePanel component within this modal I have a ASP btnEditar button with a click event to execute a update routine. After executing the event, the modal closes but its dark...
asked by 29.03.2018 / 20:00