Questions tagged [asp.net]

ASP.NET is a Microsoft web application development framework that allows programmers to build dynamic web sites, web applications and web services. It is useful to use this tag in conjunction with the project type tag e.g. [asp.net-mvc], [asp.net-webforms], or [asp.net-web-api]. Do NOT use this tag for questions about ASP.NET Core - use [asp.net-core] instead.

ASP.NET was first released in January 2002 with version 1.0 of the .NET Framework and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (), allowing programmers to write ASP.NET code using any supported .NET language.

Typically, ASP.NET uses a WebForms style of development, which was also the original method of developing web applications in ASP.NET. Web forms are a model which mimics the control/event model of classic Windows Forms development providing the illusion of stateful pages.

In March of 2009, Microsoft released version 1.0 of the ASP.NET MVC Framework. As an alternative model to web forms, this framework applies the Model-View-Controller pattern to web applications in ASP.NET.

As ASP.NET includes its own controls library for web forms, wrapping HTML controls and adding functionality to them, any ASP.NET controls have as markup <asp:ctrl_name></asp:ctrl_name>.

For example:

<asp:Label ID="Label1" runat="server"></asp:label>

Will be rendered like a <span></span>

For ASP.NET MVC, instead of a control library, there exist HTML helper methods which make it easier to blend HTML markup with code, while allowing developers to create views in mostly pure HTML.

There are two templating engines for ASP.NET MVC. The original one is and uses .aspx and .ascx files for views and partial views, respectively. The other, newer one is , which focuses on developer productivity by providing more concise and less obtrusive syntax.

More information at: www.asp.net

It is useful to use this tag in conjunction with the project type tag e.g. , , or . DO NOT use this tag for questions about ASP.NET Core - use instead.

Development Tips:

Tips for good website design, which loads and works faster

Initial release:

January 2002

Stable Release:

Stable release 4.8 (18 Apr 2019)

Latest Preview Release:

Preview release 6.0.0-preview.3 (8 Apr 2021)

Important Questions

Essential Downloads

References

Books:

Chat Room

IDE

373735 questions
45
votes
7 answers

How do I clear a System.Runtime.Caching.MemoryCache

I use a System.Runtime.Caching.MemoryCache to hold items which never expire. However, at times I need the ability to clear the entire cache. How do I do that? I asked a similar question here concerning whether I could enumerate the cache, but that…
Peter Marks
  • 989
  • 2
  • 8
  • 15
45
votes
29 answers

What's your choice for your next ASP.NET project: Web Forms or MVC?

Let's say that you will start a new ASP.NET web site/application tomorrow. Would you chose Web Forms or MVC, and why?
Click Ok
  • 8,700
  • 18
  • 70
  • 106
45
votes
3 answers

How to encrypt one entry in web.config

ASP.NET 4 I've used RSA key encryption for connection strings in web.config on my web farm. However, there's one more custom password entry that I'd like to encrypt. How should I encrypt it with RSA key without having the rest configurations being…
Stan
  • 37,207
  • 50
  • 124
  • 185
45
votes
11 answers

jQuery Validation plugin in ASP.NET Web Forms

I would really like use the jQuery Validation plugin in my ASP.NET Web Forms application (not MVC). I find it easier than adding asp validators everywhere and setting the control to validate field on all of them. I am just having some issues both…
eiu165
  • 6,101
  • 10
  • 41
  • 59
45
votes
27 answers

How to fix ASP.NET error "The file 'nnn.aspx' has not been pre-compiled, and cannot be requested."?

I have a VS 2005 web site that I publish using "Publish Web Site", and I clear all the three checkboxes. I also have a deployment project that picks up the published files and creates an MSI. I then install the package on a separate test server. In…
jonsb
  • 2,016
  • 3
  • 21
  • 24
45
votes
3 answers

ASP.NET MVC3 Partial View naming convention

I'm new to the MVC development so please bear with me. Is it really necessary to name my partial view like _Action.cshtml (with the _ underscore) to comply with the naming convention? Here's my problem I have a controller (StudentController) and an…
secretAgentB
  • 1,279
  • 4
  • 19
  • 36
45
votes
1 answer

ASP.NET - Access Session from static method/static class?

I would like to access the session object without passing it to my static helper function. This is so I can save and load things from the session object automatically with minimum extra fluff. Is it possible/how can I access the session object from…
Joshua Enfield
  • 17,642
  • 10
  • 51
  • 98
45
votes
4 answers

In memory database in .net

I have a .net application where i want to use In-Memory data structure. Please advice me how it works in compare to the physical database.
saran
  • 1,273
  • 4
  • 19
  • 34
45
votes
4 answers

Adding reference to another project from visual studio code

If a library (eg, on github) doesn't distribute itself via a nuget package, I'd have to manually include it as a reference, correct? I see a lot of reference posts for how to add a reference to a project for Visual Studio, but I can't seem to figure…
user6728767
  • 1,123
  • 3
  • 15
  • 31
45
votes
1 answer

Simple LINQ and List error: WhereListIterator`1[Task]' to type 'System.Collections.Generic.List`1[Task]'

I'm having trouble understanding my error Method: public List GetAllTasks() { var AllTasks = from t in tasks where t.Status.ToString() == "Completed" || t.Status.ToString() == "Pending" select t; …
Ken Ma
  • 705
  • 2
  • 7
  • 11
45
votes
17 answers

Page_Load is firing twice in ASP.NET page

Asp.net page_load function is loading twice.. hence it affects my page performance. Does anyone know the reason it is loading twice. No, iam not calling the page load function anywhere...
Goutham
  • 1,051
  • 3
  • 10
  • 8
45
votes
9 answers

ASP.net HTTP 404 - File not found instead of MaxRequestLength exception

I have a file upload control on my webpage. The maximum request length is set to 8 MB (maxRequestLength = 8192). I also have server validation that throws an error if the file is more than 4MB. The reason that its 8MB in the config is the leverage…
Divi
  • 7,621
  • 13
  • 47
  • 63
45
votes
4 answers

How to retrieve all certificates in your X509Store

I am using the following code to retrieve all certificates in my PC from an asp.net webapp. The certificates collection is empty, and I can't understand why. I tried impersonating my own user account and I didn't succeed as well. What am I doing…
Pablo
  • 2,054
  • 8
  • 30
  • 56
45
votes
25 answers

asp.net core 2.0 - Value cannot be null. Parameter name: connectionString

I had the following error in package manager console when Add-Migration Value cannot be null. Parameter name: connectionString This is my startup: namespace MyProject { public class Startup { public IConfiguration Configuration {…
Bing Han
  • 545
  • 1
  • 6
  • 10
45
votes
7 answers

Bind query parameters to a model in ASP.NET Core

I am trying to use model binding from query parameters to an object for searching. My search object is [DataContract] public class Criteria { [DataMember(Name = "first_name")] public string FirstName { get; set; } } My controller has the…
Carl Thomas
  • 3,605
  • 6
  • 38
  • 50
1 2 3
99
100