.NET Daily

.NET Daily


Recommended Resources


Popular Content


Navigation
CategoryTutorials
Featured

SQL

How To Solve: SQL Server detected a logical consistency-based I/O error: invalid protection option.

Posted on March 19th, 2018.

If you happen to receive the logical consistency-based I/O error, then your database probably ended up in an unusable state. SQL Server provide some options to repair it but it does that with the risk of potentially losing data. The syntax that I used to repair it is the following: ALTER DATABASE MyBrokenDB SET SINGLE_USER WITH ROLLBACK...

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

Featured

Fast SQL Server Stored Procedure with Filtering, Sorting and Paging

Posted on July 11th, 2017.

Even though there are dozens of articles out there which shows you how to do a Microsoft SQL Server stored procedure with filtering, sorting and paging, the execution time greatly differs between each approach. So I started to do some research in order to find the best approach out there. And I believe I found it on Aaron Bertrand...

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

Javascript

How to keep a button disabled until the page is loaded

Posted on May 3rd, 2016.

There are cases when you need to keep a button disabled until the page is rendered. The main reason you may need this is to prevent the user from clicking on a button that is not functional at that point. The easiest way of achieving this is to follow these 2 steps: Disable the button from HTML: <button id="add-to-cart" type="submit"...

Featured

Javascript

Little things that make a big difference in Javascript

Posted on January 24th, 2016.

Since I started working as a front-end developer, I encountered many situations when JavaScript code was buggy or had various issues even though the logic seemed correct. As a beginner it is difficult to follow all the best practices and sometimes can even be confusing, as this topic can be a bit subjective. Of course, there are a few...

Featured

Tutorials

How to install Sass and Compass on Windows

Posted on January 28th, 2015.

The first thing you need to know here is that Sass and Compass get installed as Ruby gems, so before doing anything else you need to have Ruby installed on your machine. To install Ruby on Windows you can just download the latest version of Ruby Installer and follow the guidance of the installation wizard. At this point you should have...

Featured

Tutorials

How to prepare an ASP.NET Website for deployment with PowerShell

Posted on December 7th, 2014.

Visual Studio has some very good publishing and deployment tools but when it comes to solution deployment that is also a component of stand-alone product, things get complicated because usually you have to select certain folders or certain files to move them to production or to staging server. I did a lot of research to see what is the...

Featured

Javascript

JavaScript events applied to a Dropdown control

Posted on February 19th, 2014.

Have you ever tried to dynamically open a dropdown control from a JavaScript event? Well, I’m not going to show you that because for the moment that’s almost impossible. It works only on Chrome browser. I’ve tried several tricks like assigning custom JavaScript triggers to a select tag but nothing worked on other...

Privacy Preference Center