Posts by Matheus Miranda • 5,375 points
290 posts
-
0
votes0
answers1108
viewsQ: Could not find file 'c: ... bin Roslyn csc.exe'
Follow picture: I went to update Microsoft.CodeDom.Providers.Dotnetcompilerplatform with the latest and stable version. Then I upgraded 1.0.5 to 1.0.6. He wasn’t like that anymore. Now he keeps…
asp.net-mvc-5asked Matheus Miranda 5,375 -
2
votes1
answer54
viewsQ: How to make a label with behavior="scroll"?
Follows code: <marquee behavior="scroll" direction="left">Seu texto aqui</marquee> How can I do this with label? <label class="col-sm-2 col-form-label" for="Link">Seu texto…
html5asked Matheus Miranda 5,375 -
0
votes3
answers1235
viewsA: Problems with Data and Globalize
Vinicius I know it’s complicated, I made a small tutorial here: /a/227756/54019 When you execute the command Install-Package jquery.Validation.Globalize, does not come complete package. You must do…
-
4
votes1
answer1154
viewsA: Globalize - datetime does not work with en
TUTORIAL: HOW TO CONFIGURE GLOBALIZE IN YOUR PROJECT VS2017 I will make a small tutorial here, because it was very complicated to make it work: Official website globalize:…
-
2
votes1
answer1154
viewsQ: Globalize - datetime does not work with en
Please follow the code: Global.asax: protected void Application_Start() { System.Globalization.CultureInfo.DefaultThreadCurrentCulture = new System.Globalization.CultureInfo("pt-BR");…
-
0
votes1
answer403
viewsQ: E_DEFAULT_LOCALE_NOT_DEFINED: Default locale has not been defined. - Globalize
When I type 1 number in input this error appears: E_DEFAULT_LOCALE_NOT_DEFINED: Default locale has not been defined. Imagery: I’ve tried several shapes and nothing. Follow code: Model: public class…
asp.net-mvc-5asked Matheus Miranda 5,375 -
0
votes1
answer1295
viewsQ: Invalidoperationexception: Cannot create a Dbset for 'Applicationuser' because this type is not included in the model for the context
I already have a database created in Sql Server, so I executed command: PM> Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Teste;Trusted_Connection=True;"…
-
2
votes0
answers1115
viewsQ: Asp.Net MVC 5 vs Asp.Net MVC Core?
I see many talking about Asp.net Core. Is it worth migrating MVC5 to Core ? Or should I continue with MVC5?
-
0
votes1
answer130
viewsQ: How to place a vertical line within the panel class?
Follows code: <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <script…
-
1
votes2
answers724
viewsQ: Razor in javascript file
I have a little code that works on _Layout: $.ajax({ type: "POST", url: "@Url.Action("Action", "Controller")", success: function () { //Seu código aqui ... } }); So far, so good, only _Layout is…
-
4
votes3
answers1793
viewsA: How to divide integers and get value with decimal part?
There’s no point in you using the type int that will always return integer number. You can use type decimal or double depending on what you do: decimal media = 0 , soma = 7 , cont = 2; media = soma…
-
0
votes3
answers2079
viewsA: How do I activate the Caps Lock key warning?
You can use toUpperCase() Javascript to know if the letter is capitalized, when the event keypress of Jquery is called. $('#example').keypress(function(e) { var s = String.fromCharCode( e.which );…
-
0
votes0
answers78
viewsQ: How to determine if string is strictly decimal?
I would like that if the string has the comma (as we use in the Brazilian real to represent the decimal places), it returns true and if not, return false. Example: "1" = false; "1,00" = true; "10" =…
-
1
votes1
answer499
viewsQ: It cannot be assigned as it is read-only after doing a "Join"
Controller: [HttpPost] public ActionResult Listar_Json() { var id = 5; var search = Request["search[value]"]; //Aqui pega valor digitado no input, digamos que ele digitou 100.000,01 var query =…
-
0
votes4
answers832
viewsA: Can I use onclick twice ?
You can invoke your function as a function: JS: function minhaFuncao1() { //Fazer alguma coisa aqui minhaFuncao2(); // chamar função "minhaFuncao2" } function minhaFuncao2() { // tocar som } Html:…
-
0
votes1
answer240
viewsQ: 500 (Internal Server Error) when defining action as [Childactiononly]
I want to block partialview url through url using [ChildActionOnly]. Face problem, follow code: HTML: <li style="cursor:pointer"><a id="button_id">Criar</a></li> JS:…
-
7
votes2
answers2790
viewsA: How do I use C# in Javascript? (Visual Studio 2017)
I found the solution for JS: Obs: Only works with JS code. Won’t work with Razor. Javascript Regions. Another solution is to use Visual Studio shortcut: Select your text you want. Tighten Ctrl + M…
-
3
votes2
answers2790
viewsQ: How do I use C# in Javascript? (Visual Studio 2017)
I use little to organize my C code#: #region Nome //seu código #endregion How can I do this by javascript and Razor ? @if() { //code javascript } Update: I checked my answer Gypsy Morrison Mendez…
-
1
votes1
answer580
viewsQ: How to use javascript code inside if Razor?
In my view, I have code following: <script type="text/javascript"> @if(Model.File == true) { //Como usar javascript aqui ? //Exemplo: $("#target").click(function() { alert("Handler for…
-
9
votes2
answers1167
viewsQ: Foreach of C# vs Foreach() of EF6
Follows code: ForEach() of EF6: var result = ctx.Table.Where(x => x.User == "João").ToList(); result.ForEach(x => x.Read = true); ctx.SaveChanges(); foreach of the C#: var result =…
-
0
votes1
answer142
viewsA: Use of the Signalir
To send a specific user or users, you need to map user to connection. There are 4 ways you can do this, among them are: Iuserid Provider In-memory Single-user groups Database I’ll give you a basic…
-
0
votes0
answers91
viewsQ: Sqldep_onchange with Signalr does not work
Follows code: Notificationhub : Hub private readonly static ConnectionMapping<string> _connections = new ConnectionMapping<string>(); public void SendNotification(string who) { foreach…
-
3
votes1
answer7066
viewsQ: Object reference is required for non-static "notificationhub" field, method or property
Follows code: void OnChange(object sender, SqlNotificationEventArgs e) { //from here we will send notification message to client NotificationHub.SendNotification("João"); // <----- Aqui .... }…
c#asked Matheus Miranda 5,375 -
0
votes2
answers39
viewsQ: Is it possible to change the click function to another function type?
Follows the code: var connection = $.hubConnection(); var contosoChatHubProxy = connection.createHubProxy('contosoChatHub'); contosoChatHubProxy.on('addContosoChatMessageToPage', function(name,…
-
0
votes1
answer177
viewsQ: Changing date-attribute value does not work with Jquery
Follows code: JS: $("#id_notification_count").data("count", 10); Html: <a class="dropdown-toggle"> <i id="id_notification_count" data-count="3" class="glyphicon glyphicon-bell…
-
0
votes1
answer791
viewsQ: Bootstrap-Notification does not open when clicking the bell
I use "Bootstrap Notification" here. I just want to show a dropdown type by clicking on the notification. An example to follow: But the following code happens nothing. It only shows bell. <div…
-
0
votes2
answers100
viewsQ: How to get button value when firing a Shown.bs.modal event
Follows the code: HTML: <button id="meubotao"type="button" value="5">Click Me!</button> JS: $( "#meubotao" ).click(function() { $("#myModal").modal("show"); }); I also have this code to…
-
-2
votes2
answers377
viewsQ: 2 devices connected to the same address via Wireless
I am using Visual Studio 2017 to run the application. (ASP.NET MVC) How can I make another computer connect the same url address: 192.XXXXXXXXXXX:56987. That is: 2 computers working at the same…
-
2
votes1
answer698
viewsQ: How to get Tempdata value with List<Object>?
Follows code: List<object> list = new List<object> { "abc", // string 1, // int true // bool }; TempData["ID"] = list; The following code cannot get value: var data = TempData["ID"]; var…
-
0
votes1
answer40
viewsA: Action type A is modified by clicking Action type B
I found the problem. Change that: <li>@Html.ActionLink("Início", "Index", "Home", new { @onmouseover = "this.style.color='#5cb85c';", @onmouseout = "this.style.color='';" })</li> To:…
-
0
votes1
answer40
viewsQ: Action type A is modified by clicking Action type B
Follows code: _Layout: <div class="navbar-collapse collapse"> <li>@Html.ActionLink("Início", "Index", "Home", new { @onmouseover = "this.style.color='#5cb85c';", @onmouseout =…
-
2
votes1
answer142
viewsA: Non-configuration element not declared
Solution: Go on the menu XML > Schemes... Search for file name of Dotnetconfig.xsd and change to option Usar este esquema. Here is the original answer in English here.…
asp.net-mvc-5answered Matheus Miranda 5,375 -
2
votes1
answer142
viewsQ: Non-configuration element not declared
In the Web.config, the problem occurs on the line: <configuration> Error list: Elemento 'configuration' não foi declarado. Some solution ?…
asp.net-mvc-5asked Matheus Miranda 5,375 -
2
votes1
answer185
viewsQ: The 'Connection' object can be discarded more than once in the method
Follows the code: public ActionResult Index(ViewModel model, string returnUrl) { string query = "UPDATE Table SET Status = 'C' WHERE Id = @Num"; using (SqlConnection connection = new…
-
2
votes2
answers84
viewsQ: Error running Savechanges EF6
Before it was working normally. Now I face this problem when running this code: try { db.SaveChanges(); } catch (Exception ex) { //erro aqui } Error message: Exception: Spatial types and functions…
-
6
votes1
answer285
viewsQ: What is "Helper" for in Asp.Net MVC?
Please explain to serve Helper on Asp.Net MVC. I see many examples that contain Helper. I have no idea what it is Helper. And how to create Helper ?…
asp.net-mvc-5asked Matheus Miranda 5,375 -
1
votes1
answer295
viewsQ: How to return several values of a class?
Follows code: Controller: public ActionResult teste1(int num1, int num2) { // Aqui quero obter os valores da variável model1 e model2 da classe MyClass var result = MyClass.Teste2(num1 , num2); }…
-
2
votes1
answer39
viewsQ: How to call another action and return the value?
Follows code: public ActionResult Teste1(int num1, int num2) { var valor = Teste2(1, 2); //Aqui recebe valor nulo } public ActionResult Teste2(int num11, int num22) { //Alguns valores aqui... var…
-
1
votes1
answer144
viewsQ: How to show buttons for each menu option?
$(document).ready(function() { $("#myModal").modal('show'); $('#myModal').on('show.bs.modal', function(e) { $('.chosen-select').chosen(); }); }); <link…
-
2
votes1
answer561
viewsQ: How to prevent popup blocking to return ajax post?
Follows code: JS: function OnSuccess() { var url = "/Controller/VisualizarBoleto/" + 00; window.open(url, "WindowPopup", 'width=668,height=780'); } The problem is not displaying popup, the browser…
javascriptasked Matheus Miranda 5,375 -
1
votes4
answers69
viewsQ: How to convert fields to a line with string?
Follows the code: Model: public class Usuario { public string Campo1 { get; set; } public string Campo2 { get; set; } public string Campo3 { get; set; } public string Campo4 { get; set; } public…
c#asked Matheus Miranda 5,375 -
2
votes1
answer1676
viewsQ: Cannot Convert from 'string' to 'System.Iformatprovider'
Follow the code (works): var teste = 1; var teste1 = teste.ToString("000000"); Upshot: 000001 Follow another code (does not work): var teste = "1"; var teste1 = teste.ToString("000000"); Upshot:…
-
39
votes7
answers115219
viewsA: Mask for CPF and CNPJ in the same field
In his documentation already has an example that is: On-the-fly Mask change, he used example with ZIP CODE, just change to CPF. See the code below, how the CPF and CNPF in the same field: var…
-
1
votes1
answer708
viewsQ: One of the fields must be required - Dataannotation
Code example: Model: [Required(ErrorMessage = "Campo CPF ou CNPJ obrigatório")] [Display(Name = "CPF")] public string CPF { get; set; } [Display(Name = "CNPJ")] public string CNPJ { get; set; } User…
asp.net-mvc-5asked Matheus Miranda 5,375 -
2
votes2
answers2425
viewsA: Validate Name Form
The following code will allow at least 2 characters and maximum 20 characters and not allow blank: <input type="text" name="nome" placeholder="Nome" pattern="^[a-zA-Z][a-zA-Z0-9-_\.]{1,20}$"…
-
1
votes2
answers77
viewsA: How to make the last two fields "teacher" and "enroll" only appear after selecting the option of the above field "Type"?
You will need javascript with event change and show to show: $("#tipo").change(function() { $('#teste').show(); }); Html: <div id="teste" hidden> Professor:<b>*</b> <br/>…
htmlanswered Matheus Miranda 5,375 -
0
votes2
answers423
viewsQ: How to disable "full screen" of Html5 video in any browser?
How can I disable full screen in any browser ? Follow the image where there’s a red circle: Some solution ?…
html5-videoasked Matheus Miranda 5,375 -
1
votes1
answer56
viewsQ: Field within a variable dynamically using array
Here I have code: byte[] Imagem1 = null; byte[] Imagem2 = null; byte[] Imagem3 = null; byte[] Imagem4 = null; byte[] Imagem5 = null; byte[] Imagem6 = null; How can I declare bytes[] variables inside…
c#asked Matheus Miranda 5,375 -
0
votes1
answer47
viewsQ: How to implement w3c bandwidth requests?
The video plays right. However I can’t skip the video time. Example: Skip time from 05:00 to 10:00. It just keeps spinning, and I can’t skip time. I searched on the internet and they say you have to…
-
1
votes1
answer179
viewsQ: How can I not type more than 10 characters with WYSIWYG?
Follows the code: Html: <textarea id="summernote">Escrever aqui</textarea> <h5 id="limite_vermelho" style="text-align:right;color:red"></h5> <h5 id="limite_normal"…