Questions tagged as 'c#'

3
answers

Why is onBlur not running?

I was wanting to perform a Javascript function when dropdown lost focus. I'm doing it this way, using onBlur, and it's not working: function DesabilitaFiltro() { alert("ok"); } <div class="form-group"> @Html.DropDownList("Se...
asked by 06.10.2015 / 18:57
4
answers

Why not always use Optimize Code?

In Visual Studio there is the Optimize Code that has the function of creating optimizations performed by the compiler to make your output file smaller, faster and more efficient. Why can not I always use this option in my projects?    ...
asked by 31.05.2016 / 20:24
3
answers

Add multiple items to a list

Is there any way to add multiple Int to a list<int> at a single time? Type List<Int32> ContasNegativas = new List<Int32>(); ContasNegativas.AddRange(30301, 30302, 30303, 30304, 30305, 30306, 30341, 30342, 30...
asked by 30.11.2015 / 19:57
3
answers

Read a console line in C #

   CS1503 Argument 1: Can not convert from "method group" to "object" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Teste { class Program { stati...
asked by 08.03.2018 / 04:47
3
answers

Provide file download from server

There is a feature to register the data of a client. The user selects a file from his computer, and this file is imported into the server into a separate folder, which can be a PDF , JPEG PNG . There is an editing screen for this client, w...
asked by 26.04.2017 / 18:40
2
answers

Comparing only the DateTime field date in C #

I need to compare only the date of two fields DateTime . DateTime aux = new DateTime(2016, 09, 02, 10, 0, 0); if (aux.Equals(DateTime.Now)) { //Alguma ação... } In the code above, I need to enter if when the date (09/02/20...
asked by 02.09.2016 / 15:38
1
answer

Uploading model along with uploading files

I have a web API built with ASP.NET WebAPI, I have a model that references a URI of a file (for example representing a photo in a photo gallery, or a product in a catalog) and I need to send the data to the API. / p> As for uploading the file...
asked by 07.02.2015 / 00:21
0
answers

WPF stylization failure

I have a problem with references of a style within the code. I have a DLL of several stylized components inherited from the Telerik package with just a few changes like color, size, etc ... Within the program where I want to use the compon...
asked by 04.03.2015 / 19:55
3
answers

Difference between syntax of properties in C # [duplicate]

What I researched, if I did: public int numero { get; set; } is the same as: private int numero; public int Numero { get{ return numero; } set{ numero = value; } } But in the first code snippet every...
asked by 20.07.2017 / 23:29
2
answers

Why is not this code calculating the mean correctly?

I probably should be really bad at math today so I can not do a simple code that calculates the average of two values ... I just do not understand what I did wrong ... BTW, I expect the average to be calculated like this ... (sum of several valu...
asked by 28.10.2016 / 20:31