Most voted "asp.net" questions
ASP.NET is a web application framework developed by Microsoft to allow programmers to build dynamic websites and web applications. Use the tag for traditional web forms, the classic template that provides the illusion of "stateful" pages. Do not use this tag for the style using the standard Model-View-Controller; use [Asp.net-mvc].
Learn more…1,881 questions
Sort by count of
-
7
votes1
answer871
viewsHow to instruct your browser to cache my Javascript and CSS via web.config
I reviewed my new website on Google Pagespeed Insights, I made some fixes, and now I need to cache some files (CSS and JS) in the browser. I looked for some articles/questions in Stack Overflow but…
-
7
votes1
answer542
viewsDifference between Absolute Expiration and Sliding Expiration
I am doing a POC with generic cache in C# and followed a model that shows Absolute Expiration and Sliding Expiration. Some could explain these concepts better to me? //This is for Absolute…
-
7
votes1
answer773
viewsHow to map two LIST properties using the Automapper
Registernewpessoacommand class public class RegisterNewPessoaCommand { public RegisterNewPessoaCommand(PessoaNatureza pessoaNatureza, PessoaFisica pessoaFisica, PessoaJuridica pessoaJuridica,…
-
6
votes2
answers4329
viewsString to Double Asp.NET C#
I need to convert a String value (returned by the database) to Double but when I do, it simply modifies the value. Example: the database returns 22.5, when I convert to Double at 225.0. String…
-
6
votes1
answer2229
viewsHow to add a control dynamically in C#?
How to add a control to a page ASP.NET dynamically using C#?
-
6
votes1
answer7747
viewsHow to resolve the medium trust issue in Asp.net
I’m developing a website on Asp.Net MVC5. When posting the site on Locaweb and trying to log in with my user I received the message: Attempt by security transparent method…
c# asp.net-mvc asp.net asp.net-mvc-5 asp.net-identityasked 10 years, 1 month ago Renatto Machado 715 -
6
votes3
answers1158
views'NT ANONYMOUS LOGON AUTHORITY' failure in SQL Server 2012 on remote server
I have a legal application running on my local server. I made some changes to it and prepared to publish an approval environment for testing. How we are migrating local banks and servers to a new…
-
6
votes2
answers415
viewsHow to check if Eval has null value?
I’m using the Eval property to load a field from GridView instantiated an object, the problem is when the object has no value , instead of appearing blank wanted to show a dash indicating that…
-
6
votes2
answers786
viewsModal display when submitting a form
How do I display a modal when I submit a registration form? The content of this modal will be just a message. Here’s the thing, on this form, you send a file and some information. As it usually…
javascript jquery asp.net-mvc asp.net asp.net-mvc-5asked 8 years, 11 months ago Leomar de Souza 1,074 -
6
votes3
answers789
viewsI can’t align a label inside a <td>
In a calendar, I need to put a label next to it. It turns out that the label is getting underneath it. If I open another one the label is on the far right, and I need it right next to it. Here the…
-
6
votes2
answers174
viewsHow in ASP.NET 5 is this property defined?
In ASP.NET 5 in the method Configure class Startup we can receive in the parameters a reference to an object whose class implements IHostingEnvironment. One of the properties of this class is…
-
6
votes1
answer293
viewsSelect button with one click and only open with two clicks
I have a webform Imagebutton that represents directories on a grid using Peater. How to make with 1 click just select the button, and only open with two clicks? <asp:Repeater ID="rtInlineBlock"…
-
6
votes2
answers180
viewsHow to copy a Repeater on the same page
I have a Repeater control with data filled in an aspx page, the same page has the modal, the modal appears when clicking a button. How to reuse the same Reset to list in modal? Repeater:…
-
6
votes1
answer185
viewsWhat is Level Trust of an ASP.NET application?
What is the purpose of setting up Level Trust in an ASP.NET application? It protects the server from something? It protects the application from something? In which case or for what reason it is…
-
6
votes0
answers220
viewsHow to use Oauth in ASP.NET 5?
In versions prior to ASP.NET 5, there was a middleware called "Oauth Authorization Server Middleware" that allowed adding an Oauth server to the pipeline and setting up token generation. The…
-
6
votes1
answer289
viewsDropdown filter using C# MVC 4
I have a dropdown in my view that I fill in the following way: ViewBag.NfeStatus = EnumHelper .ListAll<NfeStatus>() .ToSelectList(x => x, x => x.Description()); My model Nfestatus is an…
-
6
votes1
answer117
viewsProblem with the datakeynames property of the listview component
I get the following error when running the application: Message=Databinding: 'Gesthos.Models.Documents.Fluxoapprovacaodocumento' does not contain a Property with the name 'Sector.Code'. Error…
-
6
votes1
answer145
viewsWhat are dynamic properties?
I am studying ASP.NET and saw the following code snippet: ViewBag.QtdNovosComunicados = (from c in comunicados where c.DataCadastro > UsuarioLogado.dtUltimoAcesso select c).Count(); I understand…
-
6
votes1
answer73
viewsMeaning of expression <%# "example" %>
I’m used to seeing expressions like <%= "Olá" %> but I came across a code: <asp:Image id="imagemStatusDocumento" runat="server" ImageUrl='<%# ObtemImagem(Eval("NomeTipo")) %>' />…
-
6
votes1
answer742
viewsSelect Gridview line with checkbox
function Selecionar(elemento,cordefundo) { var Inputs = elemento.getElementsByTagName("input"); var cor = elemento.style.backgroundColor; //manter a cor default do elemento for(var i = 0; i <…
-
6
votes1
answer131
viewsCopy DLL to directory with . nuspec without referencing it in project
I created a local Nuget. It worked fine until we found a problem that I can’t solve right away. The following: There is a reference in the project, which calls another reference. Well, it turns out…
-
6
votes1
answer140
viewsDynamically use LINQ aggregator
I am trying to create a function to use Linq aggregator functions (sum, Average, Count) and I am not succeeding. I have the following code: private double…
-
6
votes1
answer177
viewsWhen to use Memorycache?
I would like a real example, not necessarily a code, on when use the MemoryCache on Web systems. What types of situation ask for its use? A little context: I participated in an interview where they…
-
6
votes1
answer527
views -
6
votes2
answers670
viewsAn Exception of type 'System.Outofmemoryexception' occurred in mscorlib.dll but was not handled in user code Asp.net
I’m having a hard time solving this mistake. My goal is to collect data from an Excel file and store it in c#variables, which in turn will be inserted into SQL Server 2012. Reading is done line by…
-
6
votes2
answers1265
viewsMVC 5 Customer side validation
I’m having trouble validating dates and numbers on the client side using MVC 5 Asp.net. Examples and tutorials I find on the internet are all outdated. I made the modifications according to this…
-
6
votes1
answer363
viewsDemora ao Enviar Email com Anexo
I am trying to send an email with attachment, without attachment, the email sends quickly, without any kind of problem, but when I place the attachment, it takes a lot, matter of minutes, and hangs,…
-
6
votes1
answer80
viewsDoubt about $.post and $.ajax behavior
I’ve always been used to using $.ajax() for all my requests of the type, and this works perfectly. An example that is even occurring now is the following: $.ajax({ type: "POST", url:…
-
6
votes0
answers272
viewsFetch the certificate from the client, not from the server
I need to get the certificate, and I would like you to search the client, not the server, I try to do this way: public static X509Certificate2 EscolherCertificado(string serial) { var store = new…
-
5
votes2
answers961
viewsHow to redirect from non-www to www?
I want my website visitors to always access with www. I want to somehow redirect in case the user tries to enter without www or Ubdomain. If you try to access exemplo.com I want to redirect to…
-
5
votes2
answers3054
viewsHow to use special characters in strings?
What are the characters for ~ and @ in the string of path in ASP.NET. Example: StreamReader srFile = new StreamReader(@"\\server\pasta\arquivo.html");…
-
5
votes2
answers351
viewsHow to recover from an Exception and send data from it?
I wonder if there is any way for when my system launches some kind of Exception it recovers only and sends me an email stating where it occurred and which Exception was launched!
-
5
votes1
answer270
viewsMotivation for OWIN
These days I read about OWIN on the MSDN website but I still can’t find a good motivation for it. What I read is that OWIN is a way to uncouple the server application so we can swap the server if…
-
5
votes1
answer543
viewsWhen a DLL goes up in the "bin" folder all users lose session
Every time I upload a DLL from my site, I take down all users who need to session to remain logged in the administration. I was using the build that turns everything into . dll and . Compiled but…
-
5
votes1
answer496
viewsChanges to the database with Asp.net MVC 5
I am starting some independent projects using Asp.net MVC 5 with Entity Framework, and more learning from the technology. And at the moment a great doubt arose. I used the code generated through a…
-
5
votes1
answer1591
viewsWorking with Excel data in C#
I need to create an application that reads a small sequence of data available each in an Excel column. My question is whether the best way is to deal directly with SQL uploading the file and then…
-
5
votes2
answers7885
viewsGrab parameters passed by url on another page
I have this call to another page, passing 2 parameters. Response.Redirect("/frmPVFichaCadastral.aspx?CdProcesso=" + vhdfCdProcesso.Value + "&CdTipoUsuario=" + vhdfCdTipoUsuario.Value) How do I…
-
5
votes2
answers422
viewsWhat are the possible cases of using a persistent connection?
I’ve been reading about Signalr for the last few days and basically realized that one of its main features is to maintain a persistent server connection with possible clients accessing the server.…
-
5
votes2
answers8672
viewsAsp.net Webforms. Timeout error exceeded in SQL Server. How to resolve?
In an application ASP.NET Webforms who uses the SQL Server 2008 I am creating a screen that has a search field that works with requests AJAX a method of a Web Service asmx. To avoid bulk requests I…
-
5
votes2
answers544
viewsProgress bar on file upload and information registration
I’m developing a project, where I upload files, as well as a record of information. Both the file and the information are registered in the same form. So far so good, but usually, when there are…
jquery asp.net-mvc asp.net asp.net-mvc-5 asp.net-mvc-4asked 8 years, 11 months ago Leomar de Souza 1,074 -
5
votes4
answers5763
viewsCapture Real User IP
How do I capture the actual Public IP/IP of the user accessing the application? The IP address of the computer I can capture normally, but I want to know the public IP address of this client.
asp.net-mvc asp.net asp.net-mvc-5 asp.net-mvc-4 asp.net-identityasked 8 years, 9 months ago Leomar de Souza 1,074 -
5
votes1
answer820
viewsProblems hiding/displaying div with Javascript
I have a relatively simple problem, but I cannot find a quick solution: I have a dropdownlist which determines which div will be displayed, and the moment the page is loaded for the first time, it…
-
5
votes2
answers205
viewsFrom . NET to Java, what technologies or frameworks do you use?
I currently have a . NET-based work infrastructure with Angular JS and a possibility of a new project using Java has emerged. With . NET I use the following technologies: ASP.NET Identity Used for…
-
5
votes2
answers675
viewsAdd PHP to ASP.NET
I am creating a website in ASP.NET and the company wants me to maintain the client area of the old site that was made in PHP. The client area consists of a login, in which after being authenticated,…
-
5
votes2
answers1027
viewsCenter image in Nav menu bar
How do I center an image in the Menu bar? When I talk about centering, I mean not the image in the middle of the bar, but whatever position it is in, that has the same "measurements" for the top and…
-
5
votes1
answer83
viewsAllow Multiple Users per Browser
For example, the Google allows you to maintain n accounts of Google wrinkled in your browser. In the case of Google, it creates a call control variable authuser who receives a inteiro, it passes…
-
5
votes2
answers1770
viewsDifference between the types of buttons
What is the difference between the following components ? <button type="button">Click Me!</button> <asp:button ID="cmdAvancar" runat="server" >Click Me!</asp:button>…
-
5
votes1
answer1588
views -
5
votes2
answers260
viewsWhat is the difference between Cssclass="example" and class="example"
I came across the following piece of code: <asp:Label ID="lblStatus" CssClass="labelFiltro" runat="server" Text="Status:"></asp:Label> Until then I didn’t know CssClass, would like to…
-
5
votes1
answer3181
viewsDecimal places c#
I have a variable of decimal type returning me the value 270.61864847349717630804948048 how do I return with only 3 houses after the comma, in case pass 270.618 only. Thanks in advance…