Posts by Matheus Miranda • 5,375 points
290 posts
-
1
votes1
answer183
viewsQ: Update problem with 1 field - EF
Follows the code: using (var db = new Entities()) { var t = new MinhaTabela { MeuCampo= 10 }; db.Entry(t).State = EntityState.Modified; db.SaveChanges(); } Table definition: CREATE TABLE…
-
1
votes1
answer271
viewsQ: What’s the difference between the two select?
Follows the code: Example: using (var ctx = new dbEntities()) { var resultado = ctx.Table.SqlQuery("Select * from Table WHERE id = 0 ").ToList<Table>(); } Other Example: private dbEntities db…
-
1
votes1
answer129
viewsQ: Database insertion problem - SQL
Follows the code: Update command works: int noOfRowUpdated = ctx.Database.ExecuteSqlCommand("Update Mapa set Geo = geography::Point(47.65100, -122.34900, 4326) where Id= 1"); What does not work is…
-
1
votes2
answers150
viewsQ: What is the difference between public async System.Threading.Tasks.Task<Actionresult> Index() and public Actionresult Index()?
Follows the code: Example 1 : public async System.Threading.Tasks.Task<ActionResult> Index() { return View(); } Example 2: public ActionResult Index() { return View(); } Please explain the…
-
0
votes2
answers78
viewsQ: Onclick calls function 2 times after changing value in browser developer mode
Follows the code: <button onclick="myFunction(1)">Meu botão</button> <script> function myFunction(num) { alert(num); } </script> Jsfiddle: https://jsfiddle.net/43mt9og8/…
-
1
votes2
answers448
viewsQ: SQL Injection or Script Injection - MVC-5 - Is it a concern?
I am developing an application in MVC-5 and read several articles about SQL Injection. I wonder if I have to take any security measures or modify my selects commands, or if in fact the MVC-5 already…
-
0
votes1
answer144
viewsA: Finish burger menu
As a colleague @Magichat suggested the link, I changed some codes. See in demo: https://jsfiddle.net/9oafk4um/ See the code: HTML: <h2>Cardápio</h2> <button…
javascriptanswered Matheus Miranda 5,375 -
2
votes2
answers866
viewsQ: Toggle - get true or false result
Follows the code: Model: public bool teste{ get; set; } View: <div class="checkbox"> @Html.CheckBoxFor(model => model.teste) </div> HTML result: <div class="checkbox"> <div…
-
0
votes1
answer269
viewsQ: How to get the total marker (Marker) on google maps?
I’m using Places search box. Here is the code: function initAutocomplete() { var map = new google.maps.Map(document.getElementById('map'), { center: {lat: -33.8688, lng: 151.2195}, zoom: 13,…
-
3
votes2
answers446
viewsQ: Regain marker latitude and longitude (Marker)
Follows the code: function initAutocomplete() { debugger; var map = new google.maps.Map(document.getElementById('map-create'), { center: { lat: -23.5505199, lng: -46.6333094 }, zoom: 11,…
-
-1
votes1
answer465
viewsQ: Googlelocationservice problem getting latitude and longitude
Follows the code: Try 1:(It works) var address = "Osasco - SP, Brasil"; var locationService = new GoogleLocationService(); var point = locationService.GetLatLongFromAddress(address); Attempt 2:…
-
2
votes1
answer757
viewsQ: How to resize image independent of size?
Follow the code below: public FileContentResult Foto_Pequeno() { byte[] byte_image = null; string query = "SELECT * FROM Imagem WHERE Id = '1'"; using (var connection = new…
-
1
votes1
answer378
viewsQ: How to apply Dropdownlistfor with bootstrap?
I have the following code: @Html.DropDownListFor(model => model.CountryId, Model.AvailableCountries, new { @class = "form-control", @readonly = true }) Upshot:…
asp.net-mvc-5asked Matheus Miranda 5,375 -
1
votes2
answers56
viewsQ: How to check input text before post?
Follows the code: @using (Html.BeginForm("Update", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form", enctype = "multipart/form-data" })) { . . . <input type="text"…
-
2
votes1
answer50
viewsQ: Selections boxes required at least 1 with Data Annotations
In the model I have: [Display(Name = "Exemplo 1")] [Range(typeof(bool), "true", "true", ErrorMessage = "Erro, marcar como true")] public bool Exemplo1 { get; set; } [Display(Name = "Exemplo 2")]…
asp.net-mvc-5asked Matheus Miranda 5,375 -
1
votes1
answer183
viewsQ: Google Chrome - Image problem in full screen
The original image is this: http://4k.com/wp-content/uploads/2014/06/4k-image-tiger-jumping.jpg I’m wearing event click to call function "toggleFullscreen". Follows the code: Html: <img…
-
14
votes3
answers1336
viewsQ: Why can’t I center image using text-align:center?
Follow the code below: HTML <div class="panel panel-default" style="height:400px"> <div class="panel-body"> <div class="form-group"> <div class="col-xs-6"> </div>…
-
0
votes2
answers116
viewsA: Dbcontext finds Connection String in Web Project, but not in Console App project
Try that one: public SiteContext () : base("SiteBanco", throwIfV1Schema: false) { Configuration.LazyLoadingEnabled = false; Configuration.AutoDetectChangesEnabled = false; }…
-
0
votes2
answers1025
viewsA: How to disable/enable button(button) when input file is empty/selected?
You can check by files.length using jquery: if ($('#img').get(0).files.length === 0) { //aqui você desativa o seu botão document.getElementById("btnEnvia").disabled = true; } else { //aqui você…
-
2
votes2
answers1555
viewsQ: How to get the bootstrap value toggle true or false?
Has a code: <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"/> <link…
bootstrap-3asked Matheus Miranda 5,375 -
0
votes1
answer44
viewsQ: How to make second select in "Read"?
Here is the code: public FileContentResult Foto() { byte[] byte_image = null; string query = "SELECT * FROM Tabela WHERE Coluna = @Parameter"; using (var connection = new…
c#asked Matheus Miranda 5,375 -
3
votes1
answer563
viewsQ: What is the difference between [Acceptverbs(Httpverbs.Get)] and [Httpget]?
What good is HttpGet and what’s the point AcceptVerbs(HttpVerbs.Get) ? Example: [AcceptVerbs(HttpVerbs.Get)] public ActionResult GetStatesByCountryId(string countryId) { return .... } Other Example:…
asp.net-mvc-5asked Matheus Miranda 5,375 -
2
votes1
answer665
viewsQ: How to check memory usage in Visual Studio?
I’m recently developing an Asp.net mvc 5 project. When I call a view (a page), the RAM runs out for 0MB. Then the PC screws. When RAM goes back to normal, it shows page view. Can anyone tell me if a…
visual-studio-2015asked Matheus Miranda 5,375 -
4
votes2
answers407
viewsQ: How to give a blank space between 2 input-group?
I have 2 input-group, they are "glued", I want to give a blank space, follows code below: <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>…
-
3
votes1
answer45
viewsQ: How to "escape" the @ in Razor
I am trying to leave @ as string. Here is the code: hint: { mentions: ['Pedro', 'Tiago', 'João', 'Maria'], match: /\B@(\w*)$/, // Problema com @ search: function (keyword, callback) {…
-
0
votes1
answer537
viewsQ: How to show PDF using server Viewer.js?
On the View page, I have the following code: <iframe style="width:800px; height:550px;" id="FileReload" src="@Url.Action("GetPDF", "Account", new { id = Model.Id })"…
-
0
votes2
answers297
viewsQ: How to pause CSS animation while music is stopped?
I made an example: function play() { //Fazer animação } function pause() { //Para animação, ficar toda linha roxa; } #animacao { position: relative; margin: 30px; } #bloco { display: block; bottom:…
-
0
votes1
answer933
viewsQ: Problem installing new Nuget Pack
I try to download PDF.js via Nuget, but it is a problem: Error: Could not install package 'PDF.js 1.3.91'. You are trying to install this package into a project that targets…
-
0
votes1
answer162
viewsQ: How to show audio preview while playing?
Hi guys from stackoverflow, Have an example Github, showing audio preview. How to do this in Asp.net mvc ? View: <audio controls style="width: 375px;height:225px;"> <source…
-
0
votes1
answer105
viewsQ: How to get the video size from the path?
Please follow the image below: Video size is inside "context" (Path: context > Files :Filelist > 0:File > size) How to get the video size from the path above ?…
javascriptasked Matheus Miranda 5,375 -
2
votes1
answer7011
viewsQ: How to remove or clear value from input file?
Hi guys from stackoverflow. It is possible to remove or clear value from input file ? I also saw another example of resetting or removing all input file using:…
-
3
votes3
answers73
viewsQ: Field inside a variable dynamically?
Follow the code below: Javascript: var img1 = false; var img2 = true; var img = "img"+1; //Resultado da variavel img é "img1". //Como converter string para variável ? //Exemplo: "img1" para img1 if…
-
2
votes1
answer92
viewsQ: Button with glyphicon-remove with size problem
Please see this link in demo: http://www.bootply.com/eiG8eKm3Ao I’m trying to center the "X" inside the red button. Code: <button id="del_photo" type="button" style="width:20px;height:20px"…
-
1
votes1
answer1210
viewsQ: How to show multiple images selected "input file"?
here is an example: http://jsfiddle.net/LvsYc/9714/ When you select 4 different images, the 4 images are the same when showing on the screen. HTML: <form id="form1" runat="server"> <input…
-
1
votes2
answers111
viewsA: Problem of changing image using Javascript
I solved problem by disabling cache through Controller: Code: [OutputCache(NoStore = true, Location = OutputCacheLocation.None, VaryByParam = "*")] Example: [OutputCache(NoStore = true, Duration =…
-
0
votes2
answers111
viewsQ: Problem of changing image using Javascript
The idea is to change image after update. I have the following code: <div id="context1" data-toggle="context" data-target="#context-menu1"> <img id="SizeImage1"…
-
1
votes0
answers73
viewsQ: Syntax problem or bug?
I’m using onclick to run a Javascript when a button is clicked on the dropdown-menu. The problem is in view: Full code of the above image: /*Linha 1*/ <div id="context-menu4"> /*Linha 2*/…
asp.net-mvcasked Matheus Miranda 5,375 -
2
votes2
answers1292
viewsQ: How to check if HTML tag has given attribute with JS?
In this code: <img id="SizeImage1" style="cursor:pointer"> As you can see, it has no attribute src. How can I know if a certain tag has a src or not using Javascript?…
-
3
votes2
answers147
viewsQ: How to give a "refresh" after updating the new video?
In my view, I have an old video, when I "upload" new video, want to automatically reload a new video after "upload". Follows the code View: <div id="embed_video" class="embed-responsive…
-
1
votes1
answer127
viewsQ: How to delete data Modal Bootstrap on the second time - ASP.NET MVC 5
When I open Modal the second time, the audio element remains the same. I already uploaded new audio and still continues the old audio. Please follow my code below. <div class="col-xs-6">…