Posts by Randrade • 21,612 points
490 posts
-
1
votes1
answer842
viewsA: Customer search by Name/Phone/Cpf Javascript/C#
Come on. The first thing will be "type" the attributes of Datatables. For this, we will create the Viewmodel DatatablesViewModel. Datatablesviewmodel.Cs using System; using…
-
3
votes3
answers2308
viewsA: Format double output with dot instead of comma
I don’t know how you’re getting this amount, because usually it comes with dot, as can be seen on the official Github of the API you are using. But you can make a simple Replace(), if you wish.…
-
9
votes4
answers5110
viewsA: How to upload images using Ckeditor?
You have two options for this. You can use some ckeditor plugin ready to upload, as already said, we have the Ckfider, Kcfinder, Image Upload, Image Upload and Browser, among many others. Now, if…
-
1
votes1
answer268
viewsA: Import HTML table based on a URL and fill a datatable
I didn’t quite understand your problem, but I will modify the code a little to try to explain better. First, the link you posted in the comments contains more than one table, so let’s get the table…
-
12
votes2
answers2428
viewsQ: Can I market software that uses a GPL license?
First of all, I must say that I am not making use of a Software under the GPL license, but of a package where the original source code was not changed, and I use only the generated DLL. Let’s say I…
-
6
votes2
answers483
viewsA: Validation of two fields with jQuery.validate and Dataannotations
There is an easier way to do this, which is by using the Ivalidatableobject. The IValidatableObject is an interface that serves precisely for this, valida obejtos. To use, simply change your…
-
1
votes1
answer224
viewsA: Login from an external system using ASP.NET MVC
In short, the way you described, there’s no way to do that. They are two distinct systems, without web service or any type of authentication together, except the same users and passwords. Only with…
-
2
votes2
answers1450
viewsA: C#url shortener
The code is working perfectly. Just make sure you pass a valid URL, for example: string urlMigreMe =…
-
4
votes2
answers179
viewsA: Function that generates file
A different approach would be to create a blob with the values. After that, just download. An example of the use would be thus: function baixarArquivo() { var nome =…
-
0
votes3
answers4021
viewsA: Changing Onclick Javascript does not work
In your model you are complicating several things. In addition to working with dynamic events. To simplify, why not do the function aluno() alter the onclick() for teacher and vice versa? Your…
javascriptanswered Randrade 21,612 -
4
votes2
answers305
viewsA: How to make an ngRepeat without a parent element?
In the Angular you have the ng-repeat-start where you can do what you want. Your code would look more or less like this: <ul class="timeline" > <li class="time-label" ng-repeat-start="item…
-
1
votes2
answers12539
viewsA: Change color of a div using JS
To allan’s response works perfectly. I’ll just add an example with the addeventlistener for knowledge purposes. You can use the Element.addEventListener() to "wait for an event" and change the…
-
4
votes2
answers117
viewsA: Why does it return TRUE and not FALSE?
Very simple... You set the value of a = 0; and of var b = a == 0;. At this time to shall have the value of 0 and b will have the value of true. Which shows the first values in inputs. After clicking…
javascriptanswered Randrade 21,612 -
2
votes2
answers63
viewsA: Is it possible to insert the character '#' (hash) in the MVC routes?
As already said, with routes it is not possible to do this. One way to do this would be to alter the return of Controller for a Redirect() to the desired page. Something like that: return…
asp.net-mvcanswered Randrade 21,612 -
4
votes2
answers257
viewsA: domain after @- HTML
If it’s only with HTML, you can use the Pattern Attribute and validate with Regex, as in the example below: <form name="myForm"> <input type="email" name="email"…
-
0
votes3
answers9298
viewsA: Return the previous page with the back button
How about doing your custom HtmlHelper however you wish? Well, for that, create a class of Extensions to create our Helper. In case you don’t know what I’m talking about, this link has a brief…
-
10
votes4
answers209
viewsQ: How to capture textarea tag with new line?
How to get the values of a <textarea> with Regex, including new line? I have the following expression to get a textarea: ([<]textarea.*[<\/textarea][>]) Online example. The problem is…
-
2
votes1
answer127
viewsA: SVG mosaic comic style
The space left over didn’t help much, but it would be something like this? .trapezio { stroke:black; stroke-width:1; filter:url("#desaturate") } #trapezio1 { fill:url(#img1); } #trapezio2 {…
-
9
votes1
answer813
viewsA: Self Relationship in EF
Following his line of reasoning, a Franquia may have a franchise list, and that’s exactly what’s missing when you use it DataAnnotations. For this, you should also use the annotation InverseProperty…
-
4
votes5
answers870
viewsA: Doubt with foreach com group by Asp.net mvc
In his View there is no method VerificarTitulos(), therefore the mistake. To show only one title (excluding other data, if different), you can do it in two ways. Group By direct consultation or…
-
1
votes2
answers57
viewsA: How to display the sum of an X value where you have the same name?
I don’t quite understand what you want, but to make a simple list from a JSON, just do the ng-repeat with the JSON. An example would be: <div ng-controller="MyCtrl"> <ul> <li…
-
15
votes2
answers3200
viewsA: Code protection . NET
In a clear and succinct response, THERE’S NO WAY! I say this is not possible by the fact that no matter how skilled you are, you will always have someone skilled enough in reverse engineering (or…
-
5
votes1
answer925
viewsA: Date-place on @Html.Editorfor
I don’t know which version of MVC you are using, so I advise you to try using TextBoxFor(), which has support for older versions. What must be done is to put the @ before the type, in this way:…
-
8
votes1
answer532
viewsA: In C#, how to use the pluralize method in Portuguese?
I believe your doubt is related to this question. As the answer contained in it, when the exception you are receiving shows that there is nothing for that purpose, so far. However, there is this…
-
4
votes3
answers149
viewsA: How to generate new code from DBO
I elaborated this answer only to encompass and try to remedy all the doubts I found in the question about SQL, including. Let’s talk about SQL first... What you want the database itself already…
-
4
votes1
answer2238
viewsA: How to get the GPS location of who access the website?
You can’t access a device’s hardware settings from the browser. The most you can do is use the HTML5 Geolocation, upon the user’s acceptance, to obtain the user’s location coordinates. As can be…
-
5
votes4
answers94
viewsA: Table A data not contained in Table B
Doing without subquery, just make a WHERE and return all who have the idCartao null. It would look like this: SELECT * FROM usuario as u LEFT JOIN cartao as c ON (c.IdUsuario = u.Id)//Altere aqui…
-
3
votes1
answer928
viewsA: Is it possible to restart the Nodejs server when a modification occurs automatically?
You can use a supervisor for this function. An alternative to this role is the nodemon. To install it is very simple, as the site shows: $ npm install nodemon -g $ nodemon app.js This question has…
-
3
votes2
answers4430
viewsA: Foreign key - Insert table 1 ID into Table 2 PHP/MYSQL
If I understood what the @Guillhermenascimento said, you can use the LAST_INSERT_ID() to recover this value. It would look something like this: INSERT INTO produto(nome) VALUES ('Produto1'); INSERT…
-
1
votes1
answer48
viewsA: Blur / Focus with Jquey
I don’t know if I understand very well what you want, but if you don’t want to let the user type anything in some inputs, you can use the event itself .phocus() for that reason. To do this, simply…
-
15
votes2
answers7839
viewsQ: What is the difference between View and Materialized View?
According to Oracle documentation, a Materialized View is a database object that contains the results of a query and a View is a logical table based on one or more tables or views and does not…
-
10
votes2
answers4980
viewsQ: How to determine the last element of a list in a foreach?
Given any list, how to know if the foreach is in the last element? There are some ways to do this, the one I see most is to save the last element and check if the current element is the same, but…
-
4
votes3
answers194
viewsA: How do you animate an anchor call?
This answer got so interesting, visually, that I’ll just translate it. You can do this using CSS only, as suggested by @Bacchus. For this, you must use the :target, which is intended to connect with…
-
2
votes4
answers1965
viewsA: How can I detect the visibility of an element (without jQuery)?
You can use the offsetParent for this, see the example below: <script> function isHidden(id) { var elemento = document.getElementById('teste'); if (elemento.offsetParent === null) {…
javascriptanswered Randrade 21,612 -
13
votes2
answers9382
viewsA: In CSS, is there any way to define the inline Hover?
In a short answer, there’s no way. In a long answer, you should not. :hover is a pseudo-selector and, by CSS, only makes sense inside the stylesheet. There is no inline style equivalent (since it is…
-
5
votes3
answers1530
viewsA: Send file and text via jquery Asp.net mvc
I think you’re complicating something too simple. Just create a form and send the data by Ajax. An example would be like this: Model public class IArquivoMetadado { public string conteudoID { get;…
-
2
votes1
answer586
viewsA: Tabbed Navigation with CSS and jQuery
You’re probably not loading jQuery to that page. The problem I see is that false() is not a function, that is, it does not have the parentheses. Remove them from your return. Of return false(); for…
-
3
votes4
answers582
viewsA: Entity Inner Join in LINQ
I will answer with the premise that the relationship is 1:N amid Login and LoginAtivo. If you do a correct modeling, the Entity Framework does all this work for you. For that, let’s adjust some…
-
8
votes4
answers281
viewsA: Is there a C# feature similar to PHP __call?
Do not try to compare C# to PHP! I do not say this out of malice, but because they are different languages with their particularities. C# is extremely typed, that is, it is not possible to do…
-
3
votes2
answers1618
views -
10
votes3
answers1063
viewsA: What is the difference between System.Web.Http and System.Web.Mvc?
There’s no such thing as "Which is the best to use?" They have different purpose. If your project is in Asp.NET MVC, there is no need to Apicontroller, in the same way that if it is Web API, there…
-
2
votes1
answer85
viewsA: Keyboard shortcuts in Ribbonwindow
Let’s read her own keybinding documentation (google translation). With the exception of function keys and numeric keyboard keys, a valid Keygesture must contain exactly one Key and one or more…
-
2
votes1
answer129
viewsA: Save uploaded data from a partialView
Apparently you’re already using the BeginCollectionItem, then I will answer from the premise that all implementation of it is correct. By your code, you are passing the navigation property on…
-
0
votes2
answers145
viewsA: Function to call other and popular inputs
Using only javascript you can create a function to call all others, as you are already doing. function calcula_tudo() { calcula_percentualGordura() calcula_massaMagra(); calcula_gordura();…
-
1
votes2
answers87
viewsA: Know if the page is in the background
I don’t know if the "present way" that the @Sergio mentioned is this, but you can use the Page Visibility API. Not supported for all browsers, as shown in the table below: In the Developer. you own…
-
4
votes1
answer126
viewsA: Fluent Mapping API 1:N cascateado
No need to use Fluent Api in your case, just add the inverse relationship properties, for example: public class Usuario { public int UsuarioId { get; set; } public string Name {get; set; } public…
-
2
votes1
answer70
viewsA: Estimated travel time using dbgeography
Depends! The class Dbgeographyc not made for it. It allows you to work with dots or shapes (polygons/shapes). The only way to calculate the time between two points is by knowing how far you can…
-
0
votes2
answers137
viewsA: Getting registration id
Let’s deal first with the mistakes in your code. The error of the question is simple, you are not passing anything as parameter to Action. Just change to the following:…
-
4
votes2
answers1332
viewsA: Convert string to Datetime in LINQ
I must point out that the form demonstrated by @Maniero is the most indicated. I will just show that there are other ways. A simple way is to use the Convert.Todatetime. This form will convert the…
-
2
votes2
answers445
viewsA: App.Config Layered Project
As you said yourself, the file App.config using is that of Startup Project. Generally changing this practice is not a good idea, because it can generate future problems, even more if you are working…