Questions tagged as 'c#'

1
answer

Change Label in view in Asp.Net MVC Project

I created a class in the Model named Payment.cs, where it has the exactly spelled attributes as the name of the fields of my pay table in the DB. I created a view for the payment information to be registered, but besides creating the view and li...
asked by 08.09.2017 / 03:21
1
answer

How to encrypt a .txt file in Windows Forms C #?

I have a job to do where I need to save data from a list to text files. These data are for the most part, password , username , idade , nacionalidade and numeroCC . At work you are asked to encrypt username ;; pas...
asked by 06.09.2017 / 12:13
2
answers

JsonResult Display DisplayName of an Enum

I'm having a problem returning the DisplayName of an enum I have the following Enum public enum TipoPessoa { [Description("Pessoa Fisica")] [Display(Name = "Pessoa Fisica")] [JsonProperty("Pessoa Fisica")]...
asked by 12.09.2017 / 19:47
1
answer

Show alerts in a Console Application C # [closed]

Already notice that maybe my doubt is very primary, but come on ... I'm doing a console-type project in C #, but I'm having trouble displaying error alerts. What I wanted to do was leave a separate part of the console for alerts, and when the...
asked by 08.08.2017 / 13:49
2
answers

How to create a View to insert multiple entities

I have an entity that has child entities, for example: - Supplier (owns the main supplier data) - SupplierEmails - ProviderTelephones - SupplierEnderts - etc ... Where each entity is a related database table. In MVC I created a Model for e...
asked by 08.08.2017 / 20:53
1
answer

How to get the value of the input hidden inside the controller using FormCollection?

I'm trying to get the value of an input hidden inside the Controller by FormCollection, but the value is zeroed. To increase the value, I'm using a JavaScript function. HTML: <form id="adicionarTituloManual" action="~/Movimento/Adici...
asked by 19.06.2017 / 13:43
1
answer

500 (Internal Server Error) when setting action as [ChildActionOnly]

I want to block partialview url via url using [ChildActionOnly] . Issue problem, follow code: HTML: <li style="cursor:pointer"><a id="button_id">Criar</a></li> JS: $("#button_id").click(function ()...
asked by 19.06.2017 / 15:52
1
answer

Is it possible to connect to a MySql database without MySql.Data.dll?

Whenever I'm going to use a MySql database in a console application or windows forms, you need to have the dll MySql.Data.dll within the application folder. With this, I wonder if you have any way to use MySql without a dll. I thought...
asked by 20.08.2017 / 01:22
1
answer

Asp.net c # DDD - problem passing data from Entity to ViewModel

I'm developing an ASP.NET MVC project, with DDD structure and using Simple Injector. I can perform persistence in BD normally, but at the moment of retrieving the information and displaying it in a list, it presents the following error message....
asked by 21.08.2017 / 00:03
1
answer

The property or indexer "MailAddress.DisplayName" can not be assigned because it is read-only

I can usually send an email. I just can not change DisplayName . Follow the code below: var body = "<p>Email From: {0} ({1})</p><p>Message:</p><p>{2}</p>"; var message = new MailMessage(); message.F...
asked by 16.08.2017 / 23:27