Questions tagged as 'c#'

1
answer

How to mix parameters within an ASP.NET Html.BeginForm

I have the following Html.BeginForm (Do not take into account if it is incorrect is a legacy code and I can not refactor this now). using (Html.BeginForm("Confirm", "Download", new { ContributorID = "exemplo"}, FormMethod.Post, new { id...
asked by 23.11.2018 / 22:50
3
answers

Use of "Contains" in search expression

I have a string _Users of type List , it contains several lines. Each line consists of an integer and a comma-separated string (usually just a string): ID (numbers only), name (letters and numbers ). What I'm trying to do is...
asked by 23.11.2018 / 21:44
1
answer

Save XML without formatting

I need to generate xml , however without jumping line, the way I generate it is all indented, how do I save without skipping line? document.LoadXml(soapEnvelope); document.Save(@"E:\nota.xml"); I tried this code below: XDocument doc...
asked by 27.11.2018 / 14:43
2
answers

How to configure custom Error 500 page?

Good afternoon, I'm starting to write errors. In my web config is installed as follows: Error 404 <customErrors mode="On" defaultRedirect="~/Erro/Error-404.html"> <error statusCode="404" redirect="~/Erro/Error-404.html" /...
asked by 28.09.2018 / 20:47
1
answer

How to show queries generated by EF core

A while ago, with a simple code within my context, it would display the queries generated by EF6 in the console or even write to a txt file ... However, today I use the Entity Framework Core in an asp.net core (MVC) application and wanted to...
asked by 03.10.2018 / 14:39
1
answer

How do I get the value of a property with Expression?

I'm trying to get the value of a property through Expression , but I'm getting the following error.    The instance property '.Rota.ApplicationName' is not defined   for type   'System.Data.Entity.DynamicProxies.FilaRaiz_9328343013D3BB1...
asked by 11.07.2018 / 20:52
1
answer

Web Extension in Visual Studio 2012

I installed Visual Studio 2012 Express on my machine and did not add the extensions needed to work on the Web. In Visual Studio there is the option to add extensions and updates. There I found several, but I do not know what options I install...
asked by 29.06.2018 / 23:40
1
answer

How to fire multiple errors in a single data check using C #

I am creating a solution where I would like to keep all business rules within my models including the error response. The problem is that I would also like to be able to capture multiple errors at once like this: public class Usuario { pri...
asked by 27.09.2018 / 15:59
1
answer

Cash drawer open command

I'm trying to make a button that sends a command to open the cash drawer connected to the TP-650 Tanca printer. Below is the method I'm trying to do. public static void abrirGaveta(bool flag) { if (flag == true && Prope...
asked by 28.09.2018 / 15:02
1
answer

Change URL of / controller? id = 1 to / controller / 1

In my view I have two buttons that pass parameters via GET to the index of my controller, the problem is that the URL does not stay with the traditional? id = 1 and I wanted to make it look like this: / controller / 1 View: @using (Html.B...
asked by 27.09.2018 / 19:59