Posts by Venatci • 344 points
15 posts
-
0
votes3
answers3565
viewsA: Use ajax with Actionlink
Here’s an example I use on my site: Razor @page.Html.DropDownList("UF", page.ViewBag.Estados as SelectList, new { onchange = "vmCadInicial.GetCidades(this.value)") Javascript this.GetCidades =…
-
0
votes2
answers142
viewsA: Generate final HTML in PHP or JS?
It depends a lot on your need and the type of application you are creating. I, in content generation, would use a lot of ajax if my application was a restricted area and did not need to index this…
-
2
votes2
answers3488
viewsA: Customer Facilities, WCF or Web API?
The two technologies can help you. In my opinion, you should opt for the technology that is closest to your knowledge. For example, WEB API supports HTTP only. WCF supports several other protocols…
-
3
votes4
answers2652
viewsA: Do an update with lambda
using (dbContext dataContext = new dbContext()) { StatusInteracao status = dataContext.StatusInteracao.Where(s => s.Login == login).SingleOrDefault(); status.StatusVisitouCount =…
-
3
votes1
answer280
viewsQ: Using SPA (Single page application) and browser back button
Someone who works with SPA knows the best way to work with the back button of the browser? For example, we have a list of users and the detailing of these users through a click. When we are on the…
-
1
votes1
answer108
viewsA: Work to relate tables
You need a Foreign key that relates the table "tbl_post" to the table "tbl_band". for example: 1º -(Table) "tbl_banda" with the field "idBanda (PK)" 2º -(Table) "tbl_post" with the field "idPost"…
-
1
votes1
answer174
viewsQ: Use of callback to work with asynchronous javascript
Following the code below, is there another better way to call the outgoing methodEmail() after receiving "Success" in the ajax called by the Video() method? Notice that I used callback as a solution…
-
0
votes2
answers264
viewsA: Single database instance
Just include the Finally and close the connection within this.
-
1
votes3
answers1020
viewsA: Good practices with bootstrap grid system
Grids within Grids can even maintain responsiveness and not compromise layout, but the html gets bad, polluted and barely readable. When finishing an html I always try to cut/remove unnecessary and…
-
0
votes2
answers286
viewsA: Toggle in a div next to (or below)
<!-- HTML --> <p class="linkToggle"> <strong><span>[+] </span>Detalhamento dos Pacotes de Serviços</strong> </p> <div class="lista…
-
1
votes2
answers491
viewsA: Best Way to Pass Data to All MVC Controllers
I would create a "user" class, with its attributes and properties, and play in a Session. I would overwrite Session whenever any update happened. A problem of this solution would be the cost that…
-
8
votes7
answers46159
viewsA: Remove repeated elements within a Javascript array
a = ["Mike","Matt","Nancy","Adam","Jenny","Nancy","Carl"]; b = {}; for (var i = 0; i < a.length; i++) { b[a[i]] = a[i]; } arr = []; for (var key in b) { arr.push(key); } It is a data dictionary…
javascriptanswered Venatci 344 -
0
votes5
answers2481
viewsA: Do not allow saving duplicate records
In your data class, using code first, you can include the "Key" attribute above the property. So you indicate that field is primary key. [Key, MaxLength(36), MinLength(36)] public string CampoId {…
-
4
votes6
answers8712
viewsA: How and when to use Finally after a Try?
"Finally" is very useful when you open a database connection and, before closing it, decide to use a "Try catch()". You can close this same connection within Finally, so you ensure that the…
-
7
votes5
answers24456
viewsA: AJAX request with pure Javascript (no Apis)
Follow the example below: try{ xmlhttp = new XMLHttpRequest(); }catch(ee){ try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }catch(e){ try{ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");…