Posts by Bruno Heringer • 1,338 points
64 posts
-
0
votes1
answer122
viewsA: Metatag Description - Special characters - Influence on SEO
The solution is simple. Just add the helper @Html.Raw See example: <meta name="description" content="@Html.Raw(ViewBag.description)" />
-
0
votes1
answer122
viewsQ: Metatag Description - Special characters - Influence on SEO
My metatag description is composed of a text, which had accents. I create it in mine Controller MVC and sending to view via viewbag. However, in my html text (via display page source code) is…
-
1
votes1
answer150
viewsA: Google Analytics use API . NET for pageviews information
After much research, and some headaches, I was able to perform the procedure as follows. DEPENDENCIES Monitoring: Google Analytics API Google Analytics: The Core Reporting API Nuget pack:…
-
1
votes1
answer150
viewsQ: Google Analytics use API . NET for pageviews information
How do I search for Pageview information from a particular URL of my website via programming using some Google Analitcs API. Note that I already have the whole site configured in Google Analytics.…
-
1
votes1
answer44
viewsQ: Is it possible to use the W3C validator for websites built in Angular.JS?
I have a project, which was done in Angular.JS. When launching the project in W3C validator i get several mistakes that I wouldn’t have to deal with. For example: Attribute Errors: ng-controller |…
-
1
votes2
answers317
viewsQ: Random list in Query Linq to Entity C#
I would like to get a list of 3 objects within a query Link. var listaPessoas = from i in this.Context.CreateObjectSet<listaPessoas>() select i; ... listaPessoas = listaPessoas .Where(x =>…
-
1
votes2
answers956
viewsA: Push a button through the keyboard
Use Javascript. First recognize which command you want to use. Then set a Function that will insert this shortcut. Finally, call the desired function. In this example: Shortcut: (Alt+'a')…
-
-1
votes1
answer207
viewsQ: C# | Format Time
I need to format a date as follows: Ex: 08:00 -> is 8h 08:30 -> is 8:30 You can do it right through DateTime.ToString();
c#asked Bruno Heringer 1,338 -
7
votes2
answers880
viewsA: C# - How to check if a string has only spaces?
Simple, use:string.IsNullOrWhiteSpace(suaString) For example: string nome = " "; if(string.IsNullOrWhiteSpace(nome)) { //Sua função }
-
0
votes2
answers990
viewsA: When changing select call run query
Your Onchange has to be in Select and not in Form. I made an example for your reference like this: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head>…
-
5
votes2
answers739
viewsQ: MVC Custom and Friendly Routes | Create a Route with only one parameter in the URL
To create a path where only the single parameter would be displayed? For example, my route is currently like this: routes.MapRoute( name: "RouteEvent", url: "{ProdutoNome}", defaults: new {…
-
0
votes1
answer365
viewsA: Angularjs ng-click called twice
After much research, including this long discussion of possibilities (Here) I was able to solve the problem as follows: Switch ng-click to IONIC’s on-tap From my research, there seems to be a bug in…
-
0
votes1
answer365
viewsQ: Angularjs ng-click called twice
I am using the ng-click to make a common javascript call. But it is being called/fired twice when I click on the call. My directive: angular.module('myApp.directives').directive('cadastrarPost',…
-
0
votes1
answer1501
viewsQ: Uncaught Error: [$injector:modulerr] for angular-material.js
I have a problem using the Angular Material JS. I have my index with references to the Angular-Material project. <head> <!-- AngularJS Material CSS using GitCDN to load directly from…
-
0
votes1
answer84
viewsQ: Javascript Function call with parameter
I need to call a function in Javascript where one of its parameters is a function. In this case, how do I pass parameters within the function call? Ex: (Function to be called first: function…
javascriptasked Bruno Heringer 1,338 -
1
votes2
answers5090
viewsA: Error localhost Visual Studio
An even simpler option is to stop the IIS service and run the project again in Visual Studio that when running (F5) again your project (by default) the visual studio will move up a new instance of…
-
1
votes4
answers708
viewsQ: Conversion of interface list into object list: (List<Interface> in List<Object>)
I need to convert a IList<Interface> in a List<Objeto>. Take the example: public interface IObjetosBase { IList<IObjetosBase> get(); } public class ObjetosBase : IObjetosBase {…
-
1
votes2
answers12370
viewsQ: How to uninstall Cordova and Ionic completely from windows
I need to uninstall Cordova and Ionic from my machine completely without leaving any reference or cache so that when reinstalling I ensure that all instances are absolutely new. I wonder what the…
-
0
votes1
answer63
viewsA: Jquery Mask is not working in Ionic’s In App Browser
I was able to solve this problem by removing the MaxLength of Input.
-
0
votes1
answer63
viewsQ: Jquery Mask is not working in Ionic’s In App Browser
I have an input type that loads a Jquery mask. $(element).inputmask('99/9999'); Browser works perfectly, but when browsing the App (from IONIC that uses the "Inapp Browser"), in some cell phones do…
-
0
votes1
answer622
viewsQ: Jquery Mobile Error Cannot read Property 'Concat' of Undefined
When I try to call the Jquery Mobile library (Using CDN or the code itself downloaded from the website Jquery Mobile. I get the following error in the Browser console (Chrome and Firefox): Uncaught…
-
2
votes1
answer308
viewsQ: Generic Method for REST Query
I need to refactor this method to make it work better. This method works perfectly when calling on an external API Rest returns list. However, it gives exception when the return object of the…
-
2
votes1
answer734
viewsQ: MVC - Creating a typed model as a generic list
I would like to create a typed model being a list of the type T. Utilizing: Razor from ASP.NET MVC 5 For example: My model in the cshtml will look like this: @model List<T> @foreach (var item…
-
2
votes2
answers689
viewsQ: Call for generic methods in C#
I built a generic method that suits me well, but I’m having difficulty in calling this method. public List<T> CriaLista<T>(params T[] pars) { List<T> lista = new List<T>();…
-
2
votes2
answers625
viewsQ: Query SQL - CASE with LEFT JOIN
I need to create a query that returns all active students and their grades for each subject. If the student has no grade for a particular subject should be returned the student, the subject and in…
-
12
votes1
answer3906
viewsQ: Javascript - Difference between `this` and `self`
I would like to understand and help the community with information. What’s the difference in the use of this and self in Javascript? Basically: What? Why use? How to use?…
javascriptasked Bruno Heringer 1,338 -
4
votes1
answer269
viewsQ: CSS - Selector "::"
In studies of CSS selectors, we have seen the selector :: in a few moments. However I did not find specific reference on this keyword :: isolated. That is, I only saw it being applied in selectors…
-
4
votes1
answer163
viewsQ: Webworker and Async - What is the difference and when to use it?
I am studying specifically an implementation of Webworker, and did not understand very well the difference between Webworker and Async in Javascript, whereas Webworker gives me an asynchronous…
-
0
votes1
answer70
viewsQ: How Web Workers Work in Chrome
I am using a Webworker and locally it is not working and I am not able to find a solution. I created a test file to illustrate here: Webworker.js var i = 0; function timedCount() { i = i + 1;…
-
8
votes2
answers357
viewsQ: Eventos Bubbles Javascript
What a Javascript Bubble Event means? I couldn’t understand the meaning and use of the Bubbles events. Following the W3schools reference: https://www.w3schools.com/jsref/event_bubbles.asp Could you…
-
5
votes2
answers439
viewsQ: Entity Framework | Double property that allows null
My property allows values double and values null. In the SQL Server Database it is set to decimal(18, 2). But when seventh some value (ex: 5.00), makes the mistake below. Error: The 'Rating'…
-
2
votes1
answer297
viewsQ: Entity - Multiplicity Constraint violated
I don’t understand the reason for this error in Entity. Could you give me a help? Error: The role 'Occurrence_occurrence_target' of the Relationship 'Addresseb.Models.Occurrence_occurrence' has…
-
4
votes1
answer65
viewsQ: Entity Framework - Object exclusion with relationship
I have a question to understand the behavior of Entity. Because when I pass null Entity should not "clean up" the relationship in the bank? My Model: public partial class Ocorrencia { [Key] public…
-
2
votes1
answer75
viewsQ: Object Type Declaration Doubt - Entity Framework
I need help in defining the correct class statement Follows my code: public void BuscaOcorremcias() { //Op 01 - Declarando um IList da Model IList<Ocorrencia> ocorrencias = null; //Op 02 -…
-
0
votes1
answer73
viewsA: Refresh in Partialview loses Javascript reference?
In fact it does not lose the reference. It turns out that Load only updates the ID Div #ComentarioAba comfort the call: $('#Comentarios').load(document.URL + ' #ComentarioAba'); To correct it was…
-
1
votes1
answer613
viewsQ: Javascript load Partialview passing a Model
I need to call a Partialview in my Javascript but I’m not sure how. I’m using a plugin that in the TARGET variable gets a Div. And this in my case, this Div I put being a Partial View. My JS is like…
-
2
votes1
answer1193
viewsA: How to change the website’s background image dynamically?
You can do it via Javascript with a timer running 5 in 5 sec. See example: // initial call, or just call refresh directly setInterval(AsyncTrocaImg, 5000); function AsyncTrocaImg() { $.post(base +…
-
0
votes1
answer36
viewsA: Doubt in Table creation
My suggestion is that you make a relationship MANY-FOR-MANY. (Here is a conceptual example. Attention to **SociosPeriodo** Conceptually speaking you need to create: create table Cadastrados( Nome…
-
0
votes1
answer73
viewsQ: Refresh in Partialview loses Javascript reference?
I have a Javascript/Jquery method that updates a Partialview and inside it there is a div with a fadeToggle associated. Javascript in Onload (to associate Fadetoggle) (Works)…
-
4
votes1
answer1244
viewsA: Optional Entity Framework include
Actually, it is not an optional Include. It is a null accepting property. The mistake was in Model, because it did not allow null, so the query was being created with the InnerJoin and not LeftJoin.…
-
2
votes1
answer23
viewsQ: Entity Framework - Lazyload with null-enabled property
What happens to a search that uses the include of Entity Framework on a property that can be null. var ocorrencia = db.Ocorrencia .Include("Pessoa") .FirstOrDefault(c => c.id == 3); That object…
-
0
votes1
answer83
viewsA: javascript result for method in parameterized controller
You will create a new call by passing the parameter data See the example below. $.ajax({ type: "POST", url: url, data: data, success: success, dataType: dataType }); In this case, you will…
-
0
votes1
answer121
viewsA: How to use Animate and fadeOut in Javascript
If I understand correctly, you want to "hide" the other sections and "show" only the one that was selected? Try it this way: First create a common class for Divs (Here I’m calling from: Divs_Sessoes…
-
1
votes2
answers81
viewsA: Identify DIV by complex id
You can use the Seletor Contais jquery. $( "div[id*='@SEUVALOR']" ).fadeOut();
-
1
votes2
answers279
viewsA: Download PDF file by link in e-mail
I use it like this to download. public FileResult DownloadAnexo(int id) { string URL = //BUSCAR URL ARQUIVO DESEJADO; return File(URL, "multipart/mixed", "Nome_SeuArquivo"); } Note that the return…
-
1
votes1
answer1244
viewsQ: Optional Entity Framework include
I have a great deal of doubt here about Include of the Entity Framework. var ocorrencias = db.Ocorrencia .Include("Pessoa") .Where(c => c.Id > 1000).ToList(); I used the Include, because I…
-
2
votes1
answer533
viewsQ: HTML + CSS - Element position relative to div
I’m failing to position my element at the top and the right end of the div. See that my div is slightly yellowish color, and my element "x" in red. This "x" is what I want to position.…
-
2
votes2
answers66
viewsQ: Include all child objects (navigation properies) in the Entity search
I wonder if it is possible to search the object completely filled without calling the include specifying each child object (with their respective children) of my class. Currently, I’m doing so:…
-
1
votes1
answer50
viewsQ: What a good practice for using Modelbinders in MVC
I’m looking to create a page using best practices in ASP.NET MVC. I was in doubt what would be the best practice for me to model my page using modelbinders to "bindar" my object automatically. In…
-
0
votes2
answers428
viewsQ: The type must be a Reference type in order to use it as Parameter 'Tentity' in the Generic type or method 'Dbset<Tentity>'
I am trying to set up an Enum in ENTITY FRAMEWORK. But I am not succeeding. My Context is like this: public class MoradaWebContext : DbContext { public DbSet<MeuEnum> Status { get; set; } }…