Posts by Lucas • 844 points
41 posts
-
1
votes1
answer89
viewsA: How to send two integer parameters to an Asp.net MVC Controller using Ajax
Basically just add one more parameter: [HttpPost] [Route("pessoa-cargo/remover-pessoa-cargo/{id:int}")] public void DeletePessoaCargo(int id, int pessoaId) { _pessoaCargoAppService.Remove(id,…
-
1
votes1
answer119
viewsA: How to place a countdown in more than one post on the page?
Let’s say you have an HTML like this: <div class="container"> <div class="row"> <div class="card col l6"> <div class="card-image col l4 pull-l1"> <img…
-
0
votes2
answers38
viewsA: Render css when transforming view into string
As Gustavo Santos said the CSS files are not loaded in an email, the tag can be used <style> for Hotmail, Yahoo! , and Windows Live Mail, but it’s worth noting that in Gmail it takes the tag…
-
0
votes1
answer170
viewsA: Check certificate X509certificate2
//Busca Certificado var certificado = new X509Certificate2(caminhoCertificado); //Instancia o registro de certificados na maquina local var store = new X509Store(StoreName.Root,…
-
0
votes1
answer54
viewsA: Problems to filter table contents using <select>
I built an example using jQuery for you, just read the comments carefully. //Primeiro vamos definir com quem vamos mexer frequentemente: const //Containers, pra fazer os selects abrir e fechar…
-
1
votes1
answer56
viewsA: Pass Httppostfilebase as parameter in the API method
You can access the files posted with Request.Files, in this way: if( Request.Files.Count > 0 ) // Se tiver algum arquivo na stream de requisição { var file = Request.Files[ 0 ]; //Pega ele.…
-
0
votes1
answer305
viewsA: Pass component to the child
You can use it props.children to pick up the child elements: const Base = React.createClass({ render: function() { return <div> <h1>{this.props.titulo}</h1>…
-
0
votes1
answer175
viewsA: Angular 1.6: Open an uibmodal within another uibmodal using "resolve"?
One option is to make the Open Modals function receive a callback: angular.module('ui.bootstrap.demo', ['ngAnimate', 'ui.bootstrap']); angular.module('ui.bootstrap.demo').controller('ModalDemoCtrl',…
-
0
votes3
answers2526
viewsA: How to add HTML with onClick event in React
The answer is simple, just read the documentation: constructor(){ //Você tem de dizer quem é "this" this.insereRow = this.insereRow.bind(this); }…
-
0
votes1
answer27
viewsA: Receive integer value in field view
Instead of formatting as "N1" in ToString use "F0", which makes it 0 numbers after the comma.
-
0
votes3
answers645
viewsA: Format date coming from SQL SERVER Database
You can break it with the method substr, that takes part of a string using a parameter that says where to start and another parameter that tells you how many characters to pick up from the initial…
-
1
votes1
answer365
viewsA: Chart.js Different color for Negative/Positive Chart bars
In reality it’s all right, only that the chart is starting from the lowest value, has an option to set as 0 the minimum value of the y-axis: options: { legend: { display: false }, //Escalas scales:…
-
1
votes1
answer42
viewsA: Appendto is not a Function/Shopping Cart using jQuery
The function $.fn.appendTo is intended not for strings, but for elemntos, example: <ul id="lista"> </ul> //busca ul const $lista = $( 'ul#lista' ); //Cria <li> e adicona na…
-
1
votes2
answers140
viewsA: Click on a link and display the value within an input
const //O input input = document.getElementById('input'), //Listener de quando clica clickListener = function(){ input.value += this.innerText; }; document //a's filhos de .links-texto…
javascriptanswered Lucas 844 -
1
votes2
answers377
viewsA: Decimal places in Javascript
Javascript numbers are always of the type Number, and are always 64-bit floating point in the IEEE 754 standard: Mantissa/Fraction: 52 bits; Exponent: 11 bits; Signal: 1 bit; The maximum value that…
-
0
votes1
answer45
viewsA: Does anyone know why elements already added inherit the new colors?
The reason for this is because randomcolor is global, and every time you change it, you change for everyone, maybe it’s better to organize the items in this format: { select : string, color : string…
-
1
votes3
answers11182
viewsA: Append javascript
As well as the question is marked with jQuery, so I will give an answer with this topic: //Adiciona um listener no onClick $('#adicionarEmail').click( () => //Pega o ListEmail adiciona um…
-
0
votes2
answers459
viewsA: What is the number of the line clicked
Well, we have some things to do here: 1º we will give a fix on your marking, placing the elements due for each part of the table: <div id="posiciona"> <table id="mostra_prod"…
-
0
votes1
answer141
viewsA: How to disable a link that is calling a modal bootstrap?
What happens is that the anchor element - <a /> - does not have the attribute disabled, but the element <button /> has this attribute. So you just switch the element: <a…
-
0
votes2
answers275
viewsA: Disable bootstrap modal
To manipulate attributes with the prefix data using jQuery it is recommended to use the function data example: Catch the data-target : let target = $( '#dtTarget' ).data( 'target' ); Change the…
-
1
votes1
answer645
viewsA: JDBC Java Web and SQL Server 2014 connection
Try using a USE [DatabaseName] before your select, this error is usually may be caused by two : Lack of user permissions used to access the account; jdbc doesn’t know which database to point to (I…
-
0
votes3
answers650
viewsA: How to copy a data snippet from a string?
One more way to do it: public IEnumerable<string> ParseMessages( string messages ) { //Separa o texto por STX....ETX var msgs = System.Text.RegularExpressions.Regex.Matches( messages,…
-
1
votes1
answer114
viewsA: Form Zera values greater than 999.99
You just need to format the data before to send to the controller, because the json parser used by it nay interprets the points used to divide the multiples of 1000. So: $( '#idDoForm' ).submit( ()…
-
0
votes2
answers684
viewsA: Pass input values to PHP
This probably solves your problem, check what is passed as input value valor by his code php. (($) => { let correctValue = (elementId) => { //Javascript não reconhece valores com ',' como…
-
1
votes3
answers403
viewsA: Loop for inside a function
In a clean way you can do : $( document ).ready( () => { $( '#navLinks .btn-nav' ).click( function () { $( '#navLinks' ) .find( '.btn-nav' ) .removeClass( 'active' ); $( this ).addClass( 'active'…
-
1
votes4
answers44155
viewsA: How to test null values in Javascript
It seems that it was not mentioned in the previous answers what values false, undefined, null, NaN , 0 , "", '' are values falsy in javascript, they are all the same thing false, explained by MDN.…
-
2
votes3
answers400
viewsA: Make a Static method in the main class that writes on the screen all even numbers from 1 to 10000 that are palindromes
Well, I’ll approach it in a more legible way. public class HelloWorld { public static void main(String[] args) { Palindromas(); } public static void Palindromas() { StringBuilder sb = new…
-
2
votes2
answers397
viewsA: Use of Enum in the case of a switch
Have you tried : switch (EnumFrutas.values()[Eventos.get(0).getFruta()]) { case MACA: tomaAcaoParaMaçã; break; case ABACATE: tomaAcaoParaAbacate; break; } So if getFruta for 0 it goes after the part…
-
0
votes2
answers71
viewsA: jQuery Generic Autocomplete Error 404
Basically we’ll create a route for your IHttpHandler: public class MeuRouteHandler : IRouteHandler //Carinha que vai "apontar" pra nossa rota { public IHttpHandler GetHttpHandler(RequestContext…
-
5
votes1
answer54
viewsA: Failed to call function with Javascript parameter
maybe var form = '#form-cursos'; should be: var form = $('#form-cursos');
-
1
votes1
answer1409
viewsA: jquery copy and paste button
window.clipboardData.getData('Text') will work in some browsers, but many in that works will open a prompt wondering if the browser can access the content of clipboard. The answer is too probably…
-
4
votes1
answer82
viewsA: Pick different records from two tables
Basically (Whereas you are using the EF( Entity Framework)): MeuContexto db = new MeuContexto();//Representação das entidades do seu Banco de dados ICollection<Offline> offline = db.Offline;…
-
1
votes1
answer85
viewsA: Why is my ajax request not working?
One thing that helps is to devise the code <script type="text/javascript"> $('#enviar').click(function(){ $.ajax({ type: 'post', data: '', url:'<?php base_url('admin/salvar_produto');…
-
0
votes2
answers70
viewsA: How to fetch a json value from the goo.Gl API to C#
Well, just give one deserialize using a type dynamic : using Newtonsoft.Json; var output = JsonConvert.DeserializeObject<dynamic>("{ \"kind\": \"urlshortener#url\", \"id\": \"AQUI VEM A URL DO…
-
1
votes1
answer642
viewsA: Function of "Like" without reloading the page?
Well, I’m gonna give you that strength : We can remove the form, since it will be asynchronous. <li> <button name="id" data-id="<?= $post["id"] ?>"…
-
0
votes2
answers33
viewsA: Detect user output from text box
The event blur is made for exactly this: $(() => { $( '#aboutPT' ).blur(() => { $( '#count_message' ).hide(/*duracao em ms/fast/slow/nada*/); }) }) Obs : where does this id come from ? (I find…
-
0
votes2
answers187
viewsA: load date time without javascript
You already tried Razor ? @Html.EditorFor(model => model.DataAvaliacao, new { htmlAttributes = new { @class = "form-control", @Value = DateTime.Now/*.ToShortDateString()*/ } })…
-
4
votes4
answers922
viewsA: How to make a combo With the days of the month?
Well, I think I understand your question... Assuming you have the number of the month and a ComboBox empty, we can do this in a few steps : First : we need to find out how many days are there in the…
-
7
votes2
answers586
views -
0
votes0
answers86
viewsQ: C# Choose Email Box when sending
I was wondering if there is any way to send emails to other inboxes, for example gmail At the moment my code for sending emails is this: using (var smtpClient = new…
-
1
votes0
answers148
viewsQ: Xml Nfse (Notablu)
Hello, I’m having trouble finding decent documentation to integrate with WebService of notablu, I need at least a template of what an XML would look like to send (preferably with caption of what…