Questions tagged as 'c#'

1
answer

Validation DataAnnotation displaying message in English

Good afternoon, In my system I made the validations with data annotations, locally the messages are displayed in Portuguese, when I publish in the hosting server the text message is displayed in English, someone knows how do I keep in Portugu...
asked by 16.10.2018 / 20:25
2
answers

GET Service - System.NullReferenceException: 'Object reference not set to an instance of an object.'

I'm working on creating a Get service in ASP.NET Core, my project contains the following structure: Certiao.Data - Class Library Inside it has Dependences , Models : Sexo.cs and DB_SDO_DEVContext.cs DB_S...
asked by 18.10.2018 / 23:46
1
answer

Pass the page html via GET Ajax

Hello, I'm trying to download an excel file by passing the html page, but when trying to send the html, it's passing as null. Ajax function exportarExcel() { var html = $("body").html(); $.ajax({ url: location.href = '@...
asked by 18.10.2018 / 17:02
1
answer

Null object with jquery ajax MVC3

I know I must be forgetting something. I am making a jquery ajax request to send a message via contact form, however the object is arriving null at controller . I tried doing with JSON.stringfy and without it, with it comes th...
asked by 15.11.2018 / 22:43
1
answer

Generate list dynamically with Linq

I have an API that uses DotNet dynamic to generate the tickets. The documentation is as follows: dynamic endpoints = new Endpoints("client_id", "client_secret", true); var body = new { items = new[] { new { name = "Primeiro item d...
asked by 30.11.2018 / 12:50
1
answer

How to write an Event without using visual studio (in .cs or simply a .txt file)

I'm trying to write a Enter Event for TB1 (textbox) This code for Form1 (in Form1.cs) , would normally write it with the help of Designer: using System; using System.Windows.Forms; namespace Project1 { // aq...
asked by 26.09.2018 / 23:01
1
answer

How to expose only a few columns of the table in a WebService via SOAP?

How can I display only a few columns in a WebService? Home Example: I need to expose only the Name and AboutName of the table: public class Cliente { public string Nome {get; set;} public string SobreNome {get; set;} public...
asked by 04.10.2018 / 21:49
1
answer

Convert Json to a Csharp Object [closed]

public IActionResult MoedaTurismo() { try { RestClient restClient = new RestClient(); RestRequest restRequest = new RestRequest(); restRequest.AddHeader("cache-control", "no-cache");...
asked by 10.12.2018 / 15:21
1
answer

How do I create "options" in Select from a worksheet? [closed]

I would like to know if it is possible to dynamically generate options in C # selection? For example, I have my selection: <select id="Selecao_itens" multiple="multiple" runat= server size="3" class="selection"> <option value=...
asked by 03.10.2018 / 15:00
1
answer

Serialize XML by treating special characters

I generate an XML from Nfse, however I need to treat the special characters, eg: ´^~Ç etc, I will serialize it this way: StringWriter sw = new StringWriter(); XmlTextWriter tw = new XmlTextWriter(sw); XmlSerializerNamespaces xsn = new X...
asked by 07.12.2018 / 19:09