Posts by Leandro Angelo • 9,330 points
440 posts
-
0
votes2
answers487
viewsA: Breaking lines in a list from the bank
You are returning the "Join" of the array and not the concatenation of the items in the variable recebeNome which should be used to receive your error messages as well. Follow the changed method.…
-
1
votes2
answers3799
viewsA: Load a Dropdownlist based on an Enum - Asp.net core
Here is another option, although I prefer the Marconcilio approach, for solving the functionality as a whole and not just this one-off issue. But I also do not agree very much with the structure…
-
0
votes1
answer56
viewsA: Critical for when to deploy
If you are working with the IIS simply add your maintenance page with the following name app_offline.htm. As long as this file is at the root of your website all requests will be redirected to it.…
-
3
votes1
answer141
viewsA: Save time of registration in the database
Given the scenario the easiest way to solve the problem is to provide the date before adding the record to the context, as in the example below. But there are other alternatives like setting this…
-
2
votes6
answers1028
viewsA: How to subtract an array
The fastest and simplest way is to convert objects into a JSON string, compare them and filter. But if there are other needs like validating if all attributes and values are present on both sides…
-
0
votes1
answer154
viewsA: Modal Bootstrap and MVC C#
You declared the variable id that should receive the data-value of the details button outside the scope of the click event, so when using it to compose the url in the .load() it is undefined because…
-
2
votes1
answer192
viewsA: Reporting Modeling in ASP NET MVC
Ideally you would create Viewmodels for your reports, but for performance and resource allocation it is best to keep queries in the database. The example you passed is a simple case and the query…
-
2
votes1
answer913
viewsA: Send Javascript by email
You can always send HTML script blocks along with your email, the problem is that it will be removed on the server or will not run. The vast majority of email clients will remove or disable script…
-
2
votes1
answer260
viewsA: Run select + update SQL query
You can do it like this: UPDATE prospect_agendamento SET age_cod_consultora_agendado = P.usu_id FROM prospect_agendamento PA WITH(NOLOCK) INNER JOIN propect P WITH(NOLOCK) ON PA.age_id_prospect =…
sqlanswered Leandro Angelo 9,330 -
1
votes1
answer2152
viewsA: Simple App C# console in Visual Studio 2017, closes without showing the result
Apparently there is nothing wrong, the console closes because the application has finished its flow... if you want to keep the window open and keep reading the "Hello, Wolrd", add a waiting point,…
-
1
votes1
answer198
viewsA: Recover data from View Asp.net
You can make the query in stock and add an error in Modelstate if the requested quantity is larger than the available. [HttpPost] public ActionResult Create(PedidoVM model) { //Consulta a quantidade…
-
0
votes1
answer144
viewsA: Launch an MVC application through a Windows Service
If you need to simulate an access to your MVC application, you need to make a request for it, not just run a class method. After all, it is an application, not a library and depends on an entire…
-
1
votes1
answer4944
viewsA: How to consume webAPI REST ASP.NET MVC
Follow a basic and robust example: First create a Viewmodel, this is not mandatory but is good practice and in the future will realize the benefits of such. namespace Exemplo.ViewModels { public…
-
1
votes1
answer44
viewsA: Jquery Slide Image Transition Error
You are already using the bootstrap, it has a component ready for it, just you implement the structure and assign the classes correctly #slideshow { width: 100%; overflow-x: hidden; } <html…
-
0
votes2
answers47
viewsA: Form creation error with Entity framework
That one undefinedcomes from JavaScript your helpers in the View are correct the problem is your button "New" That gets the following bind: $("a.btn").click(function () { var acao =…
-
11
votes6
answers2555
viewsA: How to change the title element text?
The way you are doing you are overwriting all content, below follows an example by changing only the first block of text. $(document).ready(function() {…
-
1
votes1
answer60
viewsA: What’s wrong with this form?
You need to include the attribute name in the form elements, it is through it that the Action will recognize as input parameter, in your case it failed to assign the name in his <select>…
-
2
votes1
answer428
viewsA: How to check if an XML node is null?
Its validation is reversed if Telefones[i]["DataHoraFim"].HasAttributes for true, you are assigning (DateTime?)null as the value of your parameter. You can also check if Node also exists before…
-
1
votes1
answer947
viewsA: Export HTML table to Excel keeping styles
I got a lot of that a few years ago, the only solution was to declare inline styles. I remember I had found a constraint where Excel only recognizes one class per element and in case it would not…
-
1
votes1
answer108
viewsA: Upload videos Datatype Asp.Net MVC
In System.ComponentModel.DataAnnotations.DataType, there is no specific type in the enumerator for "Video". If Upload does not meet your needs, you will need to create your own customization and…
-
1
votes2
answers744
viewsA: How to format select option with bootstrap in an Angular?
You can add the class form-control in your selects <div class="ui-g-12 ui-lg-3 ui-md-4 ui-fluid"> <label>Cidade</label> <div> <select class="form-control" name="estado"…
-
1
votes1
answer67
viewsA: How does the field update via Ajax occur?
Since you are working with an asynchronous method and need the result to continue your flow, it is necessary to chain the execution together with the callback of your first call. And considering…
jqueryanswered Leandro Angelo 9,330 -
1
votes2
answers1270
viewsA: POST method receiving object vázio. C#
Well, you are sending a JSON "object" as your Action expecting a string Content of the POST { "Teste":{ "texto":"teste de post para controller" } } Sua Action // POST: api/Teste public void…
-
1
votes1
answer29
viewsA: Appropriate way to handle data received from the server
If you’re building a service Hostwho will exchange messages with your clients, the ideal would be to use as a basis the standards already established for this type of operation, such as XML or JSON,…
c#answered Leandro Angelo 9,330 -
4
votes1
answer902
viewsA: Generate plot values and dates in a datatable c#
Here is an example of a demonstration. decimal valorTotal = 200.00M; int numeroParcelas = 3; DateTime dataPrimeiroVencimento = DateTime.Now; decimal valorParcela = Math.Round(valorTotal /…
-
1
votes2
answers581
viewsA: How to change the default bootbox OK button name?
Follow the example: $(document).ready(function() { bootbox.alert({ message: "Não foi possível processar a sua requisição. abra o log para consulta", buttons: { ok: { label: 'Enviar o relatório de…
-
1
votes2
answers755
viewsA: doubt with web printing
In your CSS add the query @media print with class nao-imprimir and then add it to the elements you want to hide during printing. $('button').click(function() { window.print(); }); @media print {…
-
1
votes2
answers53
viewsA: Attach dropdowlist item and a li Asp.net mvc
It doesn’t make sense that you have one $(document).ready() within the button click event #addPeca. I modified and transferred the logic of manipulation from your <ul id="ListPeca"> for a…
-
0
votes1
answer24
viewsA: wanted to make a server transfer to the master page
You cannot make a transport or redirect to the MasterPage.master, it is not a common page, but a resource to be used as a template when inherited by other pages. You need to create a new page to…
-
1
votes1
answer2058
viewsA: How do I place an image in Itextsharp?
It’s not just one URI, you can use the stream itself of the input parameter... but the System.Image.Image no error (if mime is correct). Finally I noticed that you did not add the image to the…
-
0
votes2
answers72
viewsA: Thread and task with static method
You can simply retrieve the Result call of its asynchronous method; string filePath = ""; var result = StreamingRecognizeAsync(filePath).Result; Example: class ConsoleApp { static void Main(string[]…
-
1
votes3
answers110
viewsA: Insert Tags from Console
You can use the createElement(), followed by appendChild(). var target = document.getElementById('target'); var elemento = document.createElement('iframe'); elemento.frameBorder = 0; elemento.style…
-
0
votes1
answer83
viewsA: Service does not go up
First point, you are calling the wrong url in your ajax, there is no .cs after the .svc url: "../sistema/Bob.Servico/Usuario.svc/GetUsuario", You need to point to a valid endpoint, by the address…
-
3
votes1
answer59
viewsA: Calculation of days comes negative. Why?
Why are you reversing the order of your comparison (to get the result you expect): DateTime dt = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1); int dias =…
c#answered Leandro Angelo 9,330 -
1
votes1
answer321
viewsA: My _Layout.cshtml file is not being recognized in the application, what to do?
To use Bundle, simply add the path to your MasterPage (_Layout.cstml) you need to add your mapping in BundleConfig And here, you should not call the specific script, but your Bundle:…
-
1
votes1
answer128
viewsA: CSS does not respond below Header
Remove the ; at the end of their classes. #topo { background-color: #C4EF25; margin: 0px; padding: 0px; width: 100%; height: auto; } #menu { background-color: #174BF3; margin: 0px; padding: 0px;…
-
1
votes2
answers97
viewsA: Multiple dropdowns on the same page
Follows: $(document).on('click',".dropbtn",function(){ $(".dropdown-content").hide(100); $(this).next(".dropdown-content").toggle(); }); // Close the dropdown if the user clicks outside of it…
jqueryanswered Leandro Angelo 9,330 -
2
votes1
answer3199
viewsA: How to return a C# error with Json Result?
If you’re treating the Exception with the catch and returning the Json with the error message, will not fall into the fail()... For Jquery your Request was successful (Httpstatus 200). What I’ve…
-
1
votes1
answer131
viewsA: Ajax does not return Json
You are running an asynchronous call and trying to iterate on a return you have not yet obtained, process the result in on the callback of the success. var Timeline;…
-
1
votes6
answers6243
viewsA: check repeated number inside the array c#
As commented, Manieiro: Set "how many repeated numbers", this can be interpreted from various forms. The proposed answer presents a solution that depends exactly on which question is being asked.…
c#answered Leandro Angelo 9,330 -
0
votes1
answer62
viewsA: ASP.NET Rich Edit
Missing you register tag prefix Example: <%@ Register assembly="DevExpress.Web.ASPxRichEdit.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"…
asp.netanswered Leandro Angelo 9,330 -
2
votes1
answer116
viewsA: How to make this email form in C#?
To illustrate, let’s say this view is returned by the action Contatos() in HomeController. Create an Overload for Contatos() receiving the parameters nome, email and mensagem adding the annotation…
-
2
votes2
answers44
viewsA: Help with HTML form
You can add your id at the FormData function editaFlor(id, descricao){ if (confirm("Confirma a alteração de " + descricao + "?")) { var myForm = document.getElementById('formflor'); var form = new…
-
0
votes2
answers603
viewsA: Get external links with PHP Curl
In the first case what happens is that you got the html code from the request and the resources are declared for virtual paths that do not exist in your application. Something you may have already…
-
0
votes1
answer48
viewsA: Tag <audio> - Fade and individual playback
I know it’s an old question, but I’ll leave an example of interaction playing with volume control. $('document').ready(function() { var player = document.getElementById("player"); var auxVolume =…
-
1
votes1
answer58
viewsA: Hide a directory from the site in Dev tools
This is because you are serving resources to the site that are located within your administrative directory sistema/class/uploads. It may even be correct that the upload is done inside this…
javascriptanswered Leandro Angelo 9,330 -
0
votes1
answer72
viewsA: Retrieve Bearer Token using a Clientid and Clientsecret
First you need to request the token in the authentication service using your Clientid and Clientsecret. Now with the "in hand" token you add the header Autorization in your request. Authorization:…
-
2
votes2
answers185
viewsA: Losing the bar ("/")
It loses the last bar because it is interpreted as part of the URL and not as its parameter value. If your token can display special characters it cannot be included in a route url this way (raw),…
-
2
votes1
answer382
viewsA: Remove Event/Function - jquery
Taking a quick look at the library code I did not find resources to destroy or remove the behaviors after initialized. You would have to implement the functionality you want. Github - paper-Collapse…
jqueryanswered Leandro Angelo 9,330 -
2
votes1
answer489
viewsA: Conditional expression type cannot be determined because there is no implicit conversion between "<null>" and "Datetime"
Restricted to the question specific error what is missing is a class conversion DateTime result of Convert.ToDateTime() for the class DateTime?. But I advise a further treatment, it is not just…
c#answered Leandro Angelo 9,330