Posts by ihavenokia • 911 points
85 posts
-
4
votes1
answer425
viewsA: Get href HTML attribute in C#
I was able to get exactly the same result in C# by installing the Csquerylatest with Nuget, and writing the following code: string htmlCode = ""; List<string> links = new List<string>();…
-
1
votes1
answer425
viewsQ: Get href HTML attribute in C#
I have the following code in a Razor view: <div id="HTMLreturned" class="row"> @Html.Raw(ViewBag.HTMLreturned); </div> <script> var nrLinks = 0; $(".enlacesMas >…
-
1
votes2
answers129
viewsQ: Change cursor in "onhover" event to HTML5 <video>
I want to change the cursor to a "hand" when I move the mouse over the buttons: Play Stop Volume Fullscreen etc.. to a video player HTML5. At the moment, the mouse pointer when it passes over the…
-
0
votes0
answers75
viewsQ: How to know when the file was loaded 100%
I have a feature that does the following: Load a video from the user’s PC using C# Put the video link in src of an HTML5 using Jquery The problem: It puts the link and shows the player, but as the…
-
1
votes1
answer197
viewsQ: Mount Regex to change string json
I have the following string, which will actually be treated as a json, stored in a column in the database in my SQL Server: {"PT":"adssadsadsd "asdada"","ES":"","FR":"","EN":""} How do I…
-
2
votes2
answers547
viewsQ: Parse with quotation marks in the middle
I have in the database a column of the type varchar that takes a JSON. That column is the description of a company, but in 4 languages. The logic I have is the following: { "PT":"Descrição com…
-
2
votes1
answer120
viewsQ: How to know the View() call link. NET MVC
I have a controller with a view at the end to show details of a company. I am making a code that allows generating a url to the company details through the goo.Gl to be easier and enjoyable to…
-
1
votes2
answers70
viewsQ: How to fetch a json value from the goo.Gl API to C#
I’m trying to use the goo.Gl API to shorten some links. The problem is I don’t know how to get the generated return json URL. See below how it is organized: { "kind": "urlshortener#url", "id": "AQUI…
-
0
votes2
answers122
viewsQ: HTML5 Local video
I have this HTML code to try to play a video that’s on my hard drive. When I open the source link directly in the browser, it plays without problem, however, using this code: <video width="750"…
-
0
votes2
answers33
viewsA: Detect user output from text box
Solution To hide information from the remaining characters when leaving textArea used the event .focusout(). It’s very simple, I leave down an example: <html lang="en"> <head> <meta…
-
1
votes2
answers33
viewsQ: Detect user output from text box
I have a text box that displays the remaining characters, as I do to take this information, using javascript, when the user has already clicked on another text box (per example)? HTML of the box and…
-
1
votes2
answers425
viewsA: Javascript Validates Date of Birth and Block Same Year
Let’s say you have this in HTML: <input type="text" id="date_start"> In javascript we have this: var date = new Date(), y = date.getFullYear(), m = date.getMonth(); var fSDate = new Date(y, m,…
-
3
votes1
answer485
viewsQ: Pass the (integer) Return from a Controller method to the View
I have this method in a controller: int GetSpot() { List<CompanyDetail> topCompanies = GetTopCompanies(); CompanyDetail topCompany1 = topCompanies.Where(x => x.Company.TopCompany ==…
-
-1
votes2
answers56
viewsQ: Error while fetching Mysql data with PHP
I can’t get information from the database using php. See the code I implemented to get this information: // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check…
-
0
votes3
answers107
viewsA: Wrong encoding in Mysql when I enter via AJAX
Solution found: The solution I found that worked for my case is as follows:: $pergunta = iconv("UTF-8", "ISO-8859-1", $_POST['pergunta']); With this change the strings are saved in the database…
-
-1
votes3
answers107
viewsQ: Wrong encoding in Mysql when I enter via AJAX
I’m having trouble finding a solution to my problem. Briefly: I send data to a table, using a php file that does querry, and an ajax call that sends all the values I need to the php file. When it is…
-
1
votes1
answer71
viewsQ: Alternatives to beforeunload Event Switch in FF
I’m working on a website and Javascript has an important role in front-end, I was using the event beforeunload to always make a check if the user edited something on the page, to warn you about…
-
0
votes0
answers117
viewsQ: Simple click on the active input the "Domsubtreemodified" event
I’m using this code: document.body.addEventListener('DOMSubtreeModified', function () { document.title = 'Editar Material *'; formChanged = true; }, false); To check for any changes in the various…
-
0
votes1
answer133
viewsA: Put variables in the URL in MVC to use with JS
I was able to solve this situation using the HTML5 History API. For those who do not already know can take a look at the mozzila website here.…
-
0
votes1
answer96
viewsA: Ignore fields to be validated using jquery.validate. 1.8.1
The solution I found to my problem was the following: I took the @Html.HiddenFor(m => m.Material.DateCreated) and in the POST action on controller put the current date like this:…
-
0
votes1
answer96
viewsQ: Ignore fields to be validated using jquery.validate. 1.8.1
I have a project at the company where I am interning and I have had some errors when validating inputs. Use ASP.NET MVC, Razor, and Javascript. When submitting all fields I get an error. Using the…
-
-3
votes2
answers382
viewsQ: Extract values from a javascript string
I have a page that presents information through AJAX. Each time I do a search, I have the value of the search and page on URL, as follows: /Material/Index?? palavraChave?? numPagina I can trace…
-
2
votes1
answer133
viewsQ: Put variables in the URL in MVC to use with JS
I have a search page that will fetch the results using ajax. Do the searches you do, the URL is always the same, because the page does not change. Is there any way I can change the URL also when I…
-
7
votes1
answer153
viewsQ: What is an equal input parameter (allocation operator)?
I have a function defined as follows: public classeDeRetorno nomeDaFunção(string param1, string param2, string param3 = "") What does the param3 = ""? It equals the parameter to ""?…
-
0
votes1
answer294
viewsQ: Create thumbnail without stretching/shrinking the image in c#
I have this code that creates me thumbnails for my project: //**** INICIO GUARDA THUMB ********** // valores para altura e largura do thumb: int resizeToWidth = 260; //px int resizeToHeight = 260;…
-
0
votes0
answers357
viewsQ: Project does not open in Visual Studio (load failed)
After opening once the VS2013 in administrator mode, a project in my solution is not open. Solution is from the company where I started to intern and know almost nothing of the code. The error is…
-
3
votes1
answer800
viewsQ: How to check if the LINQ expression does not come null
I have this expression LINQ: MaterialImage mainImage = images.First(i => i.IsMainImage == true); My problem is that images. First(i => i.Ismainimage == true) can return null if you have no…
-
0
votes1
answer156
viewsQ: How to send Partialview input to a controller?
I tried to find something that would take away this doubt, but there’s nothing concrete for what I want. I’m using Visual Studio 2015 and MVC 5 and Razor in my project. I have a form (Create) with a…
-
0
votes1
answer159
viewsA: Asp.net Identity: Registry error
What’s your Connection string? You are not connecting to the server, but only the error does not help you. Edit the question and add the code of the string Connection.
asp.net-identityanswered ihavenokia 911 -
0
votes3
answers527
viewsA: Do I need to use "Convert.Toint32()" for text?
First of all I should specify where the error occurs, so I can’t see what is wrong with the code, but it is noteworthy that what comes in the string has to be a number (If you are wrong correct)…
-
1
votes5
answers5742
viewsA: Is it possible to develop websites with C/C++?
I recommend using C#. I just started interning at a web programming company and I’m using ASP.NET and C#. In college I learned C/C++, and C# is very similar and easy to learn and the best is that it…
-
1
votes1
answer67
viewsQ: How to load a Partialview to create a comment
I am working on a project to learn ASP.NET MVC and Razor. Right now I have a model of post with a view, and a view associated with model class comment to create a new comment. I wanted to know how…
-
1
votes2
answers119
viewsQ: Calling an Accountcontroller function
I am trying to fetch the logged in user ID this way: public int CurrentUserID() { return Convert.ToInt32(User.Identity.GetUserId()); } This method is in AccountController and I want to call it any…
-
0
votes2
answers160
viewsQ: Icollection<Object> - how to create and use objects within the collection
I am working on a project using MVC5 and Entityframwork 6. I followed a tutorial to create a database from my templates. Example of a model: public class Side { public Side() { } public int ID {…
-
4
votes2
answers353
viewsQ: What is the difference between @Url.Content("~/css/bootstrap.css") and only "/css/bootstrap.css"
I am learning to program an application based on MVC4 and Bootstrap. At the beginning of the project I came across a puzzle: In the _Layout.cshtml I had <link href="css/bootstrap.css"…