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
737
votes
36 answers

How do you create a dropdownlist from an enum in ASP.NET MVC?

I'm trying to use the Html.DropDownList extension method but can't figure out how to use it with an enumeration. Let's say I have an enumeration like this: public enum ItemTypes { Movie = 1, Game = 2, Book = 3 } How do I go about…
Kevin Pang
  • 41,172
  • 38
  • 121
  • 173
729
votes
9 answers

How to get the URL of the current page in C#

Can anyone help out me in getting the URL of the current working page of ASP.NET in C#?
apekshabs
728
votes
30 answers

Can I set an unlimited length for maxJsonLength in web.config?

I am using the autocomplete feature of jQuery. When I try to retrieve the list of more then 17000 records (each won't have more than 10 char length), it's exceeding the length and throws the error: Exception information: Exception type:…
Prasad
  • 58,881
  • 64
  • 151
  • 199
697
votes
51 answers

The request was aborted: Could not create SSL/TLS secure channel

We are unable to connect to an HTTPS server using WebRequest because of this error message: The request was aborted: Could not create SSL/TLS secure channel. We know that the server doesn't have a valid HTTPS certificate with the path used, but to…
Simon Dugré
  • 17,980
  • 11
  • 57
  • 73
675
votes
9 answers

ASP.NET MVC - Set custom IIdentity or IPrincipal

I need to do something fairly simple: in my ASP.NET MVC application, I want to set a custom IIdentity / IPrincipal. Whichever is easier / more suitable. I want to extend the default so that I can call something like User.Identity.Id and…
Razzie
  • 30,834
  • 11
  • 63
  • 78
596
votes
22 answers

Unable to update the EntitySet - because it has a DefiningQuery and no element exist

I am using Entity Framework 1 with .net 3.5. I am doing something simple like this: var roomDetails = context.Rooms.ToList(); foreach (var room in roomDetails) { room.LastUpdated = DateTime.Now; } I am getting this error when I try to…
Positonic
  • 9,151
  • 14
  • 57
  • 84
589
votes
52 answers

IIS 500.19 with 0x80070005 The requested page cannot be accessed because the related configuration data for the page is invalid error

I want to upload my own asp.net website on IIS with IIS Manager. But when I do this, I get the following error HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page…
Yasmeen
  • 10,991
  • 5
  • 16
  • 15
586
votes
8 answers

Compile Views in ASP.NET MVC

I want an msbuild task to compile the views so I can see if there are compile time errors at well... compile time. Any ideas?
John Oxley
  • 14,698
  • 18
  • 53
  • 78
543
votes
27 answers

How to enable external request in IIS Express?

How can I enable remote requests in IIS Express? Scott Guthrie wrote that is possible but he didn't say how.
TedTel
  • 5,445
  • 3
  • 16
  • 6
534
votes
16 answers

How to Deserialize XML document

How do I Deserialize this XML document: 1020 Nissan Sentra 1010
Alex
  • 39,265
  • 21
  • 45
  • 42
522
votes
4 answers

What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?

I was deploying an ASP.NET MVC application last night, and found out that it is less work to deploy with IIS7 set to integrated mode. My question is what is the difference? And what are the implications of using one or the other?
Jon Erickson
  • 112,242
  • 44
  • 136
  • 174
493
votes
13 answers

WCF - How to Increase Message Size Quota

I have a WCF Service which returns 1000 records from database to the client. I have an ASP.NET WCF client (I have added service reference in asp.net web application project to consume WCF). I get the following message when I run the client…
bugBurger
  • 6,950
  • 9
  • 32
  • 39
491
votes
38 answers

Login failed for user 'IIS APPPOOL\ASP.NET v4.0'

I have a web project (C# Asp.Net, EF 4, MS SQL 2008 and IIS 7) and I need to migrate it to IIS 7 locally (at the moment works fine with CASSINI). Locally in IIS I have my Default Web Site with my deploy. Both my deploy and Default Web Site are on…
GibboK
  • 71,848
  • 143
  • 435
  • 658
486
votes
18 answers

jQuery $(document).ready and UpdatePanels?

I'm using jQuery to wire up some mouseover effects on elements that are inside an UpdatePanel. The events are bound in $(document).ready . For example: $(function() { $('div._Foo').bind("mouseover", function(e) { // Do something…
Herb Caudill
  • 50,043
  • 39
  • 124
  • 173
479
votes
30 answers

Get MIME type from filename extension

How can I get the MIME type from a file extension?
user34537