.NET Daily

.NET Daily


Recommendation


Recent Posts


Navigation
CategoryASP.net
Featured

ASP.net

ASP.NET Core. Best way to Keep Variables between Page Requests

Posted on August 19th, 2017.

In case you want to preserve some data between page requests, ASP.NET CORE MVC and ASP.NET MVC provides a more elegant solution than the classic ViewState. It is called TempData. The usage of it is pretty straightforward. The example from below shows how I assign a variable to preserve the sort state of a column in a list table:...

Featured

ASP.net

ASP.NET Core and EF: The instance of entity type ‘User’ cannot be tracked

Posted on July 9th, 2017.

This exception caused me to lose a bit more than two hours before finding the right solution. That happened even though the ASP.NET team already documented this Entity Framework behavior very well here but, you know, who has time for all that much documentation… So, the full exception message is the following: InvalidOperationException:...

Featured

ASP.net

ASP.NET Core – How to Get and Write values to HTML Inputs outside the scope of a Model

Posted on May 8th, 2017.

When you come from ASP.NET WebForms directly to ASP.NET Core, you’ll see that lots and lots of old practices for getting an adding data into web page forms have changed completely. For example, ASP.NET Core heavily rely on Models for managing form data while on ASP.NET WebForms you were totally in charge of managing that part....

Featured

ASP.net

How to Get External URL Reference in ASP.NET

Posted on December 11th, 2013.

We recently had a requirement to track the initial location of our users in a Single Sign On environment. One essential information that was needed for this requirement was to get the previous external URL from which the user came in our website. The external URL can be very easy extracted with the following code:...

Featured

ASP.net

How to open an MVC 2 Project in Visual Studio 2012

Posted on September 25th, 2013.

It seems that Visual Studio 2012 doesn’t know how to upgrade projects created in Visual Studio 2010 with ASP.NET MVC 2 (or maybe it doesn’t want to). Follow these steps in order to unlock an ASP.NET MVC 2 or MVC 1 project in Visual Studio 2012: Step 1: Right click on the project and click “Edit projectname.csproj”. Step 2: In the opened...

Featured

ASP.net

Resources to learn ASP.NET WebForms, ADO.NET, HTML, CSS and SQL

Posted on September 9th, 2013.

The main purpose of this resource list is to give you a head start in developing ASP.NET applications. As you may know, developing ASP.NET application involves a strict set of technologies that is present in almost all applications: HTML, CSS, JavaScript, C# or VB.NET and SQL. Probably there are more but these technologies are mandatory...

Featured

ASP.net

N-Tier Architecture. ASP.NET Example

Posted on August 12th, 2013.

Introduction N-tier architecture is probably one of the most used architecture models in the industry. It is used so often because it’s scalable, extensible, secure and maintainable over time. It also helps the developers with different roles to better do their job without interfering with each other. In this article I will present...

Featured

ASP.net

Front-End Performance Tips for ASP.NET Websites – Minimize HTTP Requests

Posted on August 7th, 2013.

According to Yahoo Developer website: 80% of the end-user response time is spent on the front-end. Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash, etc. Reducing the number of components in turn reduces the number of HTTP requests required to render the page. This is the key...

Featured

ASP.net

Front-End Performance Tips for ASP.NET Websites – Using Telerik to Speed Up the Page

Posted on August 2nd, 2013.

Large ASP.NET pages have big ViewState size. I think this is one of the biggest downsizes that ASP.NET Webforms has because, if you have a big number of web controls in your page, the page size will increase exponentially after Postback. A weeks ago I found that Telerik AJAX Controls Library has the RadCompression module which can enable...

Featured

ASP.net

Front-End Performance Tips for ASP.NET Websites – Add Response Headers

Posted on July 31st, 2013.

There are quite few methods to do this. You can set the Expire Headers directly from IIS, you can write a custom HttpHandler or if you don’t want custom functionality you can set them from Web.config file. Below you have an example of how you can set the expiration date from Web.config: [crayon-59e5e56b9520d383079407/] The first number...