Questions tagged as '.net'

1
answer

RenderAction does not consider my validations in ASP.NET Models

RenderAction has stopped considering fields marked as [Required] in my models. Example of one of the models: private uint IdNews { get; set; } [Required(ErrorMessage = "Defina o título.")] public string Title { get;...
asked by 08.02.2014 / 01:10
1
answer

HttpPostedFileBase null after reloading the page, (image upload)

Is there any way I can not lose data from HttpPostedFileBase ? my action does a check, and in case of failure the page reloads with the image in the form and I have to make the call again, then HttpPostedFileBase will be null, unles...
asked by 13.04.2017 / 18:37
1
answer

Object reference not set to an instance of an object. C # (in the installation)

By the error message, it was understood that there is an uninstantiated object, in which I would be referring. Error: However,thissameapplicationworksperfectlyonthedevelopmentcomputer,whenIgeneratetheinstallerandinstallonanothermachinethi...
asked by 18.06.2016 / 15:18
3
answers

How to write a date in type of ISO 8601

I'm doing a communication program with apis online and I'm using a header of type DateTime and I needed that date to be in type ISO 8601 how can I do that? I'm using this to create the header: var tempo = DateTime.UtcNow.ToStr...
asked by 08.09.2017 / 17:12
3
answers

How to get the amount of "true"?

Follow the code below: int total_true = ctx .MinhaTabela .Where(x => x.id == 5) .Select(x => new Tabela_DTO { Campo1 = x.Campo1, // database está como true Campo2 = x.Campo2, //database está como false...
asked by 31.07.2018 / 19:47
1
answer

Get month value from list

I need the person to get the information and month that he wants, so I need to get this information from the list and then show the card, date, time of entry and exit, amount paid and total of the month. I was trying to Split() but I coul...
asked by 02.04.2018 / 18:25
4
answers

How to create a switch..case with ranges of values?

If a total of days is greater than 30 and less than 60, I do something. If it's bigger than 60 and smaller than 90 I do something else and so on. How do I case ? Is case the best option?     
asked by 26.03.2014 / 13:53
2
answers

Read ZIP file contents without writing to disk

In the program I'm writing, I download a ZIP file over the internet and then need to upload the extracted ZIP files to another place. It turns out that I can not find a way to read the contents of this ZIP file - now a Stream - without first...
asked by 02.01.2019 / 22:29
3
answers

How do I activate confirm the form by enter? [closed]

I'm doing a C # program that plays within TextBox into Grid , but I'm only getting through a button. I want to know how do I for the provider user the first given, hit enter, skip for age, and after that hit enter again information...
asked by 26.07.2017 / 20:19
1
answer

Delphi = C #: Generic function to return collection bill DV

I'm having problems with a Custom Module 11 function (which correctly returns the billing slip from any bank) that I already had in Delphi, and how I need to implement it on a C # system. So I tried to make the C # version of it, but it is wi...
asked by 27.04.2016 / 00:39