Skip to main content

Posts

Showing posts with the label Asp.Net

Access SQL LocalDB by an application hosted in local IIS

Introduction: SQL server express LocalDB  is a developer's database, which is a lightweight edition of Microsoft SQL. It works as same as SQL with fewer features. LocalDB can be created and managed by VisualStudio or SQL management studio. Using visual studio we can create database LocalDB either from "SQL Server Object Explorer" or by using code first approach using any asp.net web application. To configure LocalDB to an application hosted in local IIS, we need to set up a few additional settings. Here we are going to discuss the common problems and solutions while configuring. Create ASP.NET Core MVC Sample Application: Create asp.net MVC Dotnet core application. In VisualStudio, while selecting an MVC application template we can select the authentication option, in that select individual login option. After the project creates initially run the application using IIS Express server which is a prebuilt server in VisualStudio. We can observe a sample ap

Asp.Net Route Constraint: Single Url To Load Desktop Page Or Mobile Page By Device Request

Introduction: In modern web development every application targeting all devices, like desktop, mobile, and tablet, etc. For that, everyone follows the most common approaches like: 1. Design a Single page with responsiveness for all devices. 2. Maintaining multiple domains for devices like for desktop ( https://example.com ) and for mobile devices ( https://m.example.com ) Existing Approach Problems: In the first approach, a single page with responsiveness for all devices needs to write a lot of CSS and HTML code. This may result in affecting page load time with heavy CSS leads problems like  CSS Render Blocking . In the second approach, with multiple domains targets different pages for each domain like for desktop requests one page and mobile request another page gets loaded. With this approach, there is no unnecessary loading of CSS and Html gets loaded. But the problem in this approach needs to maintain different domains. Solution (Asp.net Route Constraint): Asp.net