Posts by Marcus Vinicius • 4,826 points
139 posts
-
0
votes1
answer25
viewsA: Redirect restaurants in Ajax
It is possible to redirect a page by resetting the href property of the object Location: document.location.href So in your case, supposing for example you want to redirect to…
javascriptanswered Marcus Vinicius 4,826 -
3
votes2
answers3734
viewsA: Limit decimal places float c#
Use the {0.00 formatting} Console.WriteLine($"A média das despesas foi de: {mediadesp:0.00} R$"); ... Console.WriteLine($"A média das receitas foi de: {mediareceit:0.00} R$");…
-
2
votes4
answers6996
viewsA: Typeerror Cannot read Property 'name' of Undefined at Angular 4
William’s response may work, but I’ll suggest an alternative: In your service, let the method that makes the request return an Observable: import 'rxjs/add/operator/map'; ... pesquisarUSD():…
angularanswered Marcus Vinicius 4,826 -
2
votes1
answer416
viewsA: Error while consuming webservice in c#
In order for the call to work from a different source, you must set up Cross-Origin Resource Sharing (CORS). For an ASP.Net project with ASMX, the following section on the web.Config can solve your…
-
1
votes1
answer42
viewsA: Objects with javascript
You need to convert the string into json format for a valid object before trying to use it: var obj = JSON.parse(data); document.getElementById('pteste').innerHTML = obj.potions['1'].name; Only it…
-
1
votes1
answer175
viewsA: Why does my array return a Undefined
If you want to return a new array with the name property, try using the map method as follows: obj1 = { nome : 'name', array : [], funcao : function(element){this.array.push(element)}, getArray :…
-
3
votes1
answer1041
viewsA: CQRS - When to use and why to use?
In short, CQRS is useful and recommended in complex domain scenarios or high-performance applications. Phrasing Microsoft documentation when compared to conventional CRUD model: Compared to the…
-
0
votes1
answer72
viewsA: Radiobutton on the Repeater?
What happens is that with each Postback your Radiobutton runs, the Repeater Databind occurs again, causing the source element and the event to be lost. Try moving both lines:…
-
3
votes1
answer67
viewsA: What is the difference between Class and Code File on Asp.net Core?
The "Class" option generates a C# code file with a basic class structure, like this: using System; using System.Collections.Generic; using System.Text; namespace ConsoleApp1 { class Class1 { } }…
-
2
votes2
answers73
viewsA: Jquery accumulating events
Before adding an Handler to the event "Hidden.bs.modal", try to remove the previous Handler using the method off jQuery: // Essa linha $('#edit').off('hidden.bs.modal');…
-
0
votes2
answers53
viewsA: Doubts regarding applet 'param' and an Archive pointing to a jar
The param properties can be recovered in Applet code, as follows: String paramCampo = getParameter("campo"); Using your example HTML code, the variable value paramCampo in which case it would be…
-
2
votes1
answer105
viewsA: Combobox loading wrong array information
The problem is that you are deserializing the return JSON as a collection of anonymous objects and the Combobox control does not know which property to display, as each Combo item is an array. By…
-
4
votes1
answer1524
viewsA: What is the Expect100continue property for in System.Net.Servicepointmanager?
Code 100 is an HTTP protocol status. Its purpose is to allow a client, before sending the content (body) of a request to the server, to send the headers (header) so that the server already…
-
0
votes1
answer421
viewsA: Existing user validation in C#
I think that’s not what you want, but if an Exception occurs means the user already exists, then you must change the code to return something in the block catch. No. NET, when an Exception occurs in…
-
2
votes2
answers80
viewsA: How to change a button event?
Assuming you have a method: Sub ButtonClick(sender As Object, e As EventArgs) End Sub You can associate with the event Click as follows: AddHandler Button1.Click, AddressOf ButtonClick…
vb.netanswered Marcus Vinicius 4,826 -
1
votes1
answer857
viewsA: How to save the PDF generated by reportviewer to disk at runtime?
Use the method File.Writeallbytes in the resulting array byte of the method Render: System.IO.File.WriteAllBytes("C:\\ExportedReport.PDF", bytes); You will need to use a logic to create different…
-
1
votes2
answers1735
viewsA: How to make a button that calls an iframe
Hide the <iframe> with CSS (display:none) When clicking the button, use javascript to display, as follows: function exibirIframe() { document.getElementById("iframe").style.display = "block";…
-
4
votes4
answers492
viewsA: Orable DB and MVC 4 - Connection error (ORA-06413)
This error is commonly caused by incompatibility of architectures between the Oracle DLL and the application that is running. If you are using the 64bit version of the DLL for example, in Web…
-
14
votes2
answers3131
viewsA: How can I turn line breaking into <br /> in Javascript?
There is a project in Github called php.js, which proposes to convert PHP functions into Javascript. They port this function as follows: function nl2br (str, is_xhtml) { var breakTag = (is_xhtml ||…
-
1
votes1
answer419
viewsA: Host ASP.NET Project on IIS on Machine Itself
Not being fixed IP, the way is to use a dynamic DNS service like the NO-IP or Dyn DNS. Most routers already allow you to configure one of these services directly by their internal settings utility.…
-
0
votes1
answer666
viewsA: Handling of JQUERY parents and siblings
Something like that? $(document).ready(function() { $("#checkbox1").click(function(){ var checked = $(this).is(":checked"); if(checked)…
-
1
votes1
answer901
viewsA: Update a viewbag (c# Razor) with a javascript variable
Can’t change Viewbag from Javascript since Viewbag is a feature that works entirely on the server side. Otherwise, however, it is possible: you can define a javascript variable that receives a value…
-
2
votes2
answers1052
viewsA: Pass data encrypted by URL in ASP.NET MVC
Continue using your encryption in the parameters, but to avoid problems with not allowed characters in the Url, before sending the string, use the method Httpcontext.Current.Server.Urlencode(). When…
-
3
votes4
answers2109
viewsA: "Filter" equal records into a list by adding their quantitative
A response using the extension methods of System.Linq and return with anonymous objects: var resultado = lstTeste .GroupBy(x => x.Codigo) .Select(x => new { Quantitativo = x.Sum(y =>…
-
11
votes1
answer13542
viewsA: Startar site on IIS is returning error 500
The actual error you are getting as your screenshot is: This configuration section cannot be used in this path. This occurs when the section is locked on a parent level. Lock is by default…
-
4
votes2
answers525
viewsA: Removing strings from html files
You can remove comments using Regex, as follows: string semComentarios = Regex.Replace(stringHtml, @"<!--(.*?)-->", String.Empty); See an example working in that fiddle.…
-
4
votes1
answer305
viewsA: Tabs bootstrap don’t come back
The elements <li> cannot be inserted inside the element <div>. In the bootstrap semantics, they must be inserted inside the tag <ul>. The correct HTML would be: <script…
-
2
votes1
answer1794
viewsA: How can I check if an object exists in the dictionary and return it
Change the passage: foreach (KeyValuePair<string, Park> x in parques) { if (parques.ContainsKey(nomeParque)) { Console.WriteLine("Nome: " + x.Key); } } To if(parques.ContainsKey(nomeParque)) {…
-
2
votes1
answer1033
viewsA: Use Onblur in Asp.Net with problems!
1 - You can, and even recommend not to use the server for this type of client interaction. To add the event onblur, simply use: <asp:TextBox onblur="minhaFuncao()"></asp:TextBox> This is…
-
4
votes1
answer322
viewsA: Call Jquery function in HTML created via Javascript
For dynamically created elements, the click does not work. To work, you must use the method on: $('#tabelaRotas').on('click', '.excluir', function() { var nome = this.id; alert(nome); });…
-
3
votes2
answers523
viewsA: How to create progress bar for uploading file via Google Drive API
You will have to use the event ProgressChanged: FilesResource.InsertMediaUpload request = _service.Files.Insert(body, stream, body.MimeType); request.ProgressChanged += Upload_ProgressChanged; ....…
-
3
votes1
answer183
viewsA: Fetch phrase within files . Cs from a specific folder using C#
You can use the classes Directoryinfo and Fileinfo, as follows: DirectoryInfo dirInfo = new DirectoryInfo(@"C:\projetos\projeto\src"); foreach (FileInfo arquivo in dirInfo.GetFiles("*.cs",…
-
2
votes3
answers3527
viewsA: Swap characters inside a string, in a string
Can use regex, as follows: C# string original = @"aaaaaaaaaa""aaaa""aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa""aaaaaaaaaa""aaaaaaaaaaaaa"; // percorre todas os valores que estejam entre…
-
4
votes3
answers117
viewsA: Architectural problem where access to construction methods should be controlled
I see two ways to force the execution order of class methods Arvore: • Making methods private AdicionarTronco, AdicionarGalho, AdicionarFolha and AdicionarFruto and call them only in a public method…
-
3
votes1
answer193
viewsA: Problem with HTML link with classic ASP
In that part: & #calendario "' target='blank'>" & You are trying to concatenate a variable #calendario. This is an invalid name for a variable in Vbscript, so it cannot exist. Even if it…
-
2
votes2
answers940
viewsA: Doubt how to call several different images
I have the following idea for your problem, but it will depend on you using some conventions: the images should all be in the same format and the images related to Coloured should be in the format…
-
1
votes3
answers821
viewsA: What is an object returned in parentheses?
What is an object returned between parentheses? The answer to your question is simple: the object itself! There is no difference in the value or behavior of an object placed in parentheses in this…
javaanswered Marcus Vinicius 4,826 -
3
votes3
answers1950
viewsA: How to Fix File Upload Error?
You have to increase the maximum size of the request, through the property maxAllowedContentLength. Probably your . rar is exceeding the standard size which is 30.000.000 bytes (approx. 30MB):…
-
23
votes4
answers23311
viewsQ: Force Javascript File Update Without Disabling Cache
In a large-scale web application I develop there is a disorder every time updates happen, because browsers, especially Google Chrome, do cache of Javascript files and, sometimes, incompatibilities…
-
0
votes1
answer399
viewsA: Mount Grid according to XML tags
You can read XML as Xdocument and convert it to an object as follows: Set a class to represent XML values: public class Certidao { public string CodigoRetorno { get; set; } public string…
-
2
votes1
answer181
viewsA: Error Upload images with ajax
I fixed some things in your code and the upload is working now. See comments in the code. I changed the line: document.getElementById('reponse').innerHTML = "Enviando Imagens.." To…
-
2
votes1
answer98
viewsA: Doubt about the property "Animation-name"
Yes, this is a custom name that should reference the name given to the directive @keyframe. According to W3 specification: The estate Animation-name sets a list of animations that apply. Each name…
-
2
votes1
answer315
viewsA: Dropdownlist postback with jQuery or Javascript
I used your code on a test page and it’s clearing the value of Dropdownlist, after making the following changes: • Place the parameter CliendIdMode="static" in the Dropdownlist ddlSalas:…
-
1
votes3
answers2396
viewsA: How to read the first three characters of a string?
You can do it like this: char *minhastring = "HTJxxxxxxxxxxxxxxxxxxxx"; // string lida no arquivo char tres_primeiros[4]; // três caracteres mais o terminador de linha // copia os três primeiros…
canswered Marcus Vinicius 4,826 -
2
votes1
answer1263
viewsA: Send object via POST between Javascript
What you’re trying to do doesn’t make much sense, if you’re dealing with Javascript, communicate via objects and functions. POST is an HTTP verb for communicating with the server. Making an analogy,…
-
1
votes2
answers305
viewsA: Only constructors without parameters and initializers are supported in LINQ to Entities - Asp.Net MVC
On your return, change: db.Cursos.Select(c => new CursoInscricoes(c, db.AlunoCursos.FirstOrDefault(ac => ac.Aluno.Equals(aluno) && ac.Curso.Equals(c)) != null)) To:…
-
1
votes2
answers1983
viewsA: Based on a date, know what is the week of the year
Can solve using the class Gregoriancalendar, which allows the manipulation of dates for both the Gregorian calendar (the one we currently use) and Julian: Date data = new Date(2015, 06 /* Mês */,…
javaanswered Marcus Vinicius 4,826 -
4
votes1
answer560
viewsA: Pass array as parameter does not work
Use the json_encode for that reason: <script> galerias(<?php echo json_encode($parametroGal); ?>); </script> The way you were doing, you treated Array PHP as if it were a string.…
-
1
votes1
answer676
viewsA: How to use Updatepanel in gridview?
Change the attribute ChildrenAsTriggers for false. This attribute causes all child controls to cause the PostBack. If you need some specific control to be used as a trigger, configure it as follows:…
-
1
votes1
answer445
viewsA: AES and RSA encryption compatible with PHP libraries
Start by reading the class documentation Rsacryptoproviderservice and AES. Here examples, taken from MSDN itself, of how to use them: RSA encryption: static public byte[] RSAEncrypt(byte[]…