Posts by Marcus Vinicius • 4,826 points
139 posts
-
5
votes1
answer728
viewsA: Ajax in different project
This error is caused by you making an ajax request from a different domain, probably in your case it is only the port that differs, as both must be on the localhost. To solve, just add the header…
-
0
votes1
answer27
viewsA: Select in items that have not been inserted
Simulating your case with the following table structures: CREATE TABLE Dvds(`id` int, `nome` varchar(29)); CREATE TABLE DvdsAlugados(`id_dvd` int, `id_usuario` int); You can select which ones are…
mysqlanswered Marcus Vinicius 4,826 -
5
votes1
answer4355
viewsA: Link does not work when clicked
In the <head> page, has a script: jQuery(document).ready(function($) { $(".scroll").click(function(event){ event.preventDefault(); $('html,body').animate({scrollTop:$(this.hash).offset().top},…
-
1
votes1
answer34
viewsA: Insert objects into an Array without copying them
You can use the extension method Any of System.Linq, as follows: For Each iKey As String In MethodList If Not toAdd.Any(Function(x) x.Text = iKey) Then toAdd.Add(New AutocompleteItem(text:=iKey, 7))…
-
1
votes1
answer329
viewsA: Use include with Jquery Mobile?
One way to do what you want is to use the load jQuery. Let’s say you have the files: header.html <div> <img src="meulogo.png" alt="Meu Logo" /> <h1>Minha página</h1>…
-
1
votes2
answers879
viewsA: Create a routine within an Asp net application in c#
There is a service FREE called A Trigger, where you register and can schedule calls to a Webservice. You can schedule directly through the control panel of your own website or use a library that…
-
3
votes1
answer549
viewsA: What is the relationship between MVC and Project Standards?
In the book Design Patterns: Elements of Reusable Object-Oriented Software, considered the Desing Patterns Bible, the MVC standard is cited in the Smalltalk language. According to the book, the MVC…
-
1
votes1
answer53
viewsA: Where to get an Assembly from the Roslyn compiler?
I’m using the package that is in Nuget without problems, remembering that it is still a prerelease. It can follow the development on Github. If you’re using Visual Studio, open nuget command prompt…
-
2
votes2
answers5377
viewsA: Compare "input" element values with javascript or jQuery
Utilize $("elemento").val() nay .value(): var username = "admin"; var password = "admin"; function validarUsuarioSenha() { if ($("#usuario").val() == username && $("#senha").val() ==…
jqueryanswered Marcus Vinicius 4,826 -
4
votes2
answers664
viewsA: How to share functions between javascript files?
You can dynamic load the script by creating a tag scriptand insert it into the page. For example: Arquivo1.js function Script1() { this.DigaOla = function() { alert("Sou do script 1"); } };…
-
1
votes1
answer1912
viewsA: Returning HTML Fragment with Ajax
I did a simulation of something close to what you need so: In PHP, return a JSON from an array containing the HTML of the header and Body: <?php $header = "<div>Meu Header</div>";…
-
1
votes2
answers3514
viewsA: Delete in the database using ajax and jquery
First, you have to put in your query the user ID, which by its delete code is COD_IDENT_USUAR: $resultado = mysql_query("SELECT TXT_NOMEX_USUAR, TXT_ENDER_EMAIL, FLG_STATU_USUAR, DAT_ULTIM_LOGIN,…
-
1
votes2
answers65
viewsA: Doubt about ajax
These lines are not at all correct: String lista_Cont = $(this).attr('<?php include "listaUsuario2.php";?>'); $("#lista").load(this.lista_Cont); Variables in javascript are typed dynamically,…
-
1
votes1
answer286
viewsA: Modal does not work after Load div
Try to use: $('#list_container').on('click', '.conta_finaliza', function(e) { e.preventDefault(); var id = $(this).data('id'); document.getElementById('id_conta').value = id;…
-
1
votes3
answers145
viewsA: Problems when displaying javascript string
Apparently, the string is encoded. If you use the function encodeURIComponent in string "Nutrition" will get "Nutri%C3%A7%C3%A3o". Then, to correct, use: var curso =…
-
1
votes1
answer102
viewsA: Error message when generating report
The name of Dataset passed as argument of ReportDataSource should be the same as the one configured in the RDLC file of the report. Then the creation of Reportdatasource should be: ReportDataSource…
-
0
votes2
answers691
viewsA: Popular Dropdownlist with JSON
The method each jquery takes two parameters: the object index in the array and the current iteration object: $(result).each(function (índex, value) { ddl.append( $('<option />', { value:…
-
1
votes1
answer539
viewsA: Show success/error message after postback
Try to use the method ClientScript.RegisterStartupScript: protected void btnSalvar_Click(object sender, EventArgs e) { try { // código para salvar ClientScript.RegisterStartupScript(this.GetType(),…
-
2
votes1
answer1503
viewsA: Iframe with my domain as source does not load. How to resolve this?
It will not be possible to display the page you have since the server on which it is hosted is sending the following header: X-Frame-Options: SAMEORIGIN Meanwhile header is being sent, it will not…
-
1
votes2
answers154
viewsA: How to recover the option on click and select the item that is in its value?
With jQuery, you can do it like this: $("select[name=escolhe_tema]").change(function() { var $iframe = $("iframe[name=preview-frame]"); $iframe.attr("src", $(this).val()); });…
-
2
votes3
answers471
viewsA: How to make webservice run without user interaction?
Instead of creating another webservice, you can use the service To Trigger It’s a service FREE where you register and schedule the call of a Url in a predetermined time interval. If you prefer, you…
-
1
votes1
answer652
viewsA: Set value within a Jquery variable
What is happening is that the return of the AJAX call is asynchronous, ie when the return of the function obtemvalores occurs, the variable $resultado has not yet received the value of the…
-
2
votes1
answer2159
viewsA: How to display an Alert and clear fields with classic Asp?
There is no way to display an Alert or clear controls with Asp, use javascript for this. The most you can do is insert the javascript code on the Asp page, more or less like this: <%…
aspanswered Marcus Vinicius 4,826 -
2
votes2
answers596
viewsA: How to display the content of a queue?
If you want a more compact mode: Console.WriteLine(String.Join(Environment.NewLine, fila)); The static method String.Join joins items in a collection with a character (in this case line break).…
c#answered Marcus Vinicius 4,826 -
1
votes4
answers572
viewsA: Upload Ajax - Php
Try adding to your Xmlhttprequest: client.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); I know yet another method to perform the upload, having it only the limitation of…
-
4
votes3
answers55998
viewsA: Run php function with onclick
You will have to use Ajax. Assuming that the php file containing your function is called "meuajax.php", using jQuery, you can use: function chamarPhpAjax() { $.ajax({ url:'meuajax.php', complete:…
-
2
votes1
answer291
viewsQ: Competition Webservices ASMX with Ajax
I realized that when called by XHR, the ASMX webservices can handle few simultaneous requests. Consider the following scenario: Page ASPX: <asp:ScriptManager ID="scrManager" runat="server">…
-
1
votes1
answer302
viewsA: How to create variables for the status of an order?
Use an Enum: public enum StatusPedido { EmTransito = 1, Cancelado = 2, Entregue = 3 } So in your class Pedido: public class Pedido { ... public StatusPedido Status { get; set;} ... }…
c#answered Marcus Vinicius 4,826 -
1
votes1
answer615
viewsA: Syntactic sugar?
It is difficult to separate exactly what is exactly sugary from what is not. It is also difficult to define all the sweets of C#, but here are some that make the code much clearer. lock That: lock…
-
7
votes1
answer162
viewsA: Is there any risk of submitting form with HTML?
ASP.NET, by default, validates whether there are HTML elements and other special characters in the data sent by the server. The reason for this is protection against vulnerabilities such as HTML…
-
1
votes1
answer656
viewsA: Image of the database in reportviewer
Set the property EnableExternalImages for true: this.reportViewer1.LocalReport.EnableExternalImages = true; And use an absolute path and in the following format: string caminho =…
-
4
votes1
answer3496
viewsA: Convert datetime to dd/MM/yyyy
The following code correctly formats the date, confirm that your code is equivalent: <asp:GridView ID="grid" runat="server" AutoGenerateColumns="false"> <Columns>…
-
2
votes1
answer132
viewsA: helps in removing a certain string
I’m no expert on Java, but that should do it: String pegaValorName = "<td><input type=\"radio\" name=\"pg4\" value=\"NAO\" /></td>"; String partes[] =…
javaanswered Marcus Vinicius 4,826 -
1
votes2
answers601
viewsA: Change time and end date according to start
One solution will be to convert the string value of the initial date and time textboxes to an object Date Javascript only and add one hour to its value. After that, just convert back to two strings…
-
2
votes1
answer2217
viewsA: Put HTML5 to read an RSS?
You could easily read the XML feed with jQuery, which has functions for XML interpretation. However, to read an RSS of another site with HTML and Javascript, will bump into a security restriction,…
-
1
votes1
answer670
viewsA: Repeat query with javascript
Change your code to: window.setInterval(function(){ document.getElementById("changePanel").click(); }, 2000); However, I suggest, instead of simulating the click, encapsulate a function with the…
-
0
votes2
answers1060
viewsA: Send email Login & Password C# windows Form
There’s nothing wrong with your last code Dispose of SmtpClient. It is also not necessary to convert the number 587 to integer as it is already an integer. The code I used, copied from yours, and…
-
2
votes4
answers3804
viewsA: Lock CTRL key in All Browsers
You can prevent them from "copying" your website using events oncopy and oncut: <body oncopy="return false" oncut="return false"> Keep in mind that this will make it impossible to copy and…
-
2
votes2
answers576
viewsA: @If inside a <body> tag
If you want to make the HTML code a little clearer, you can separate the condition into a block by part and declare a variable in it with the attribute value: @{ string bodyAttr = String.Empty;…
-
1
votes2
answers4590
viewsA: Add a line<tr> before another line that has an ID
Using jQuery, you can use insertBefore, thus: $("<tr><td>Outro teste</td></tr>").insertBefore("#id_2"); Or with pure Javascript, without jQuery: var tr =…
-
0
votes2
answers93
viewsA: Only take the last links from a sitemap
If you want to return the last 10, but not backwards, you can create an extension method: namespace Extensoes { public static class IEnumerableExtensions { public static IEnumerable<T>…
-
5
votes1
answer660
viewsA: How to send Winform images to a Webapi service c# on both sides
You can use a property of the type String in the MEUOBJETO and upload the serialized image as Base64 string: string imagemBase64 = Convert.ToBase64String(umaImagem); // umaImagem é um byte[]…
-
2
votes4
answers444
viewsA: Mark contacts/hashtag in typing text with javascript
Using jQuery UI Autocomplete, I was able to solve this problem as follows: Whereas I have the arrays preloaded, usuarios and tags, I use the function startsWith to check if the text starts with "@"…
-
2
votes2
answers40
viewsA: Filedialog doubt c#
You can do it like this: button2.Enabled = Path.GetExtension(openFileDialog1.FileName) == ".cnf"; button3.Enabled = Path.GetExtension(openFileDialog1.FileName) == ".csr";…
c#answered Marcus Vinicius 4,826 -
1
votes3
answers130
viewsA: How to implement methods in Json using Serializable?
ASMX Webservices only support POST and GET. ASMX is a legacy technology and should not be considered in new developments, mainly because Microsoft, since 2009, has announced that it will no longer…
-
3
votes2
answers3250
viewsA: How to sort a combo select by the text of options?
You can use the Array.prototype.sort(): function ordenar() { var itensOrdenados = $('#itens option').sort(function (a, b) { return a.text < b.text ? -1 : 1; }); $('#itens').html(itensOrdenados);…
-
1
votes3
answers1452
viewsA: Copy value between quotation marks C#
You can use Regular Expressions to find the file name in the text: using System; using System.IO; using System.Text.RegularExpressions; public class Program { public static void Main() { string…
c#answered Marcus Vinicius 4,826 -
1
votes1
answer2175
viewsA: How to allow line breaking in gridview?
The solution is to define the following property in the column you want there to be line break: ItemStyle-Wrap="True" Or simply don’t put any property. The default of GridView Asp.NET is to break.…
asp.netanswered Marcus Vinicius 4,826 -
1
votes2
answers167
viewsA: Combobox come blank VB.NET with INNER JOIN
If you just want to clean up the ComboBox: meucbx.Items.Clear()
-
1
votes2
answers88
viewsA: Ensure that a set of functions function correctly
My suggestion is the adoption of the standard Work Unit (Unit of Work). Its definition is basically: Maintains a list of objects affected by a transaction of business objects and coordinates the…