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
46
votes
9 answers

No executable found matching command dotnet-projectmodel-server

I'm getting this error when opening .NET Core projetcs in VS 2015 Community: The following error ocurred attempting to run the project model server process (1.0.0-preview-003585). Unable to start the process. No executable found matching command …
rsilvanet
  • 473
  • 1
  • 5
  • 9
46
votes
2 answers

Session.Clear() vs. Session.RemoveAll()

Is there a difference between Session.Clear() and Session.RemoveAll()? The descriptions and documentation pages seem to say exactly the same thing, but I am assuming there must be some reason for creating two functions, am I right?
Nishant Kumar
  • 5,995
  • 19
  • 69
  • 95
46
votes
2 answers

Alternative to System.Web.Security.Membership.GeneratePassword in aspnetcore (netcoreapp1.0)

Is there any alternative to System.Web.Security.Membership.GeneratePassword in AspNetCore (netcoreapp1.0). The easiest way would be to just use a Guid.NewGuid().ToString("n") which is long enough to be worthy of a password but it's not fully random.
Ovi
  • 2,620
  • 7
  • 34
  • 51
46
votes
7 answers

Error handling (Sending ex.Message to the client)

I have an ASP.NET Core 1.0 Web API application and trying to figure out how to pass the exception message to the client if a function that my controller is calling errors out. I have tried so many things, but nothing implements IActionResult. I…
Blake Rivell
  • 13,105
  • 31
  • 115
  • 231
46
votes
4 answers

What exactly is Appdomain recycling

I am trying to figure out what exactly is Appdomain recycling? When a aspx page is requested for the first time from a DotNet application, i understand that an appdomain for that app is created, and required assemblies are loaded into that…
kudlur
  • 1,215
  • 3
  • 15
  • 23
46
votes
2 answers

ASP.NET in Chrome getting a strange focus_change nikkomsgchannel error

Very recently I started to get some strange focus_change errors show up in the console window in Chrome when navigating through my ASP.NET web application (details below). I can't find anything on the internet that references a "nikkomsgchannel" and…
kmoo01
  • 545
  • 1
  • 4
  • 7
46
votes
5 answers

Disable *all* exception handling in ASP.NET Web API 2 (to make room for my own)?

I want to wire up exception handling in a middleware component, something like this: public override async Task Invoke(IOwinContext context) { try { await Next.Invoke(context); } catch (Exception ex) { // Log…
Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402
46
votes
5 answers

Is there a way to throw custom exception without Exception class

Is there any way in C# (i.e. in .NET) to throw a custom exception but without writing all the code to define your own exception class derived from Exception? I am thinking something similar you have for example in Oracle PL/SQL where you can simply…
Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
46
votes
5 answers

Adding custom properties for each request in Application Insights metrics

I d'like to add custom properties to metrics taken by Application Insights to each request of my app. For example, I want to add the user login and the tenant code, such as I can segment/group the metrics in the Azure portal. The relevant doc page…
JYL
  • 8,228
  • 5
  • 39
  • 63
46
votes
6 answers

ASP.NET Identity + Windows Authentication (Mix mode - Forms + Windows)

I have tried my best to search the web before asking this question. I've seen similar questions on stackoverflow, however, none has been answered satisfactorily for a long time now. This is one more attempt to get this recurring question…
46
votes
6 answers

Post Back does not work after writing files to response in ASP.NET

What I have? I have an ASP.NET page which allows the user to download file a on a button click. User can select the file he wants from a list of available files (RadioButtonList) and clicks on download button to download it. (I should not provide…
Vijay
  • 2,133
  • 4
  • 27
  • 40
46
votes
10 answers

Disable User in ASPNET identity 2.0

I am looking for a way to disable the user instead of deleting them from the system, this is to keep the data integrity of the related data. But seems ASPNET identity only offers Delete Acccount. There is a new Lockout feature, but it seems to…
anIBMer
  • 1,159
  • 2
  • 12
  • 20
46
votes
11 answers

Cannot use a leading ../ to exit above the top directory

I have a asp.net web site with it we have admin area with login page for admin only and all site is allowed for all - i need to ask how to define the right security configuration for it as i get this error Cannot use a leading .. to exit above the…
user186816
46
votes
3 answers

Displaying standard DataTables in MVC

Perhaps this is just completely wrong, but back in the days of Webforms you would return a Dataset which you would then bind to a grid. But now in MVC you're not supposed to pass a datatable because you cannot serialize it and it's technically…
JonathanTien
  • 1,386
  • 1
  • 11
  • 13
46
votes
3 answers

'Newtonsoft.Json...' exists in both 'Blend\Newtonsoft.Json.dll' and 'Solution\packages\...\

I'm not able to build the solution in Visual Studio 2013. This just happened after I updated my JSON.NET package to 6.0.1. Before that, it was working like a charm. Any ideas? PS: It's probably something about OWIN. It references JSON.NET too I…
Seregwethrin
  • 1,319
  • 2
  • 13
  • 24