Skip to main content

Posts

Showing posts with the label mvc

Restrict Uploaded File Size in ASP.NET Core

  Introduction In ASP.NET Core, you can restrict the uploaded file size using the RequestSizeLimit attribute in the Program.cs file or by configuring it in the appsettings.json file. Additionally, you can set the maximum file size programmatically in your controller actions. Why do we need to restrict uploaded File Size in an ASP.NET Core? Preventing Denial of Service (DoS) Attacks:  Allowing unrestricted file uploads can open your application to DoS attacks where malicious users upload excessively large files, consuming server resources and potentially crashing the application or degrading its performance. Limiting file sizes helps mitigate this risk by preventing excessively large uploads. Optimizing Server Resources:  Large file uploads consume server resources such as memory and disk space. By restricting file sizes, you can better manage these resources, ensuring that your application remains responsive and efficient, especially in shared hosting environments where r...

How to Install IIS on Windows 10?

How to Install IIS on Windows 10? Installing IIS on Windows 10 Step-1  Go to your Windows Features Settings to  Turn Windows Features on or off . Step-2  Select the features as mentioned in the images to turn them on. Step-3  Click on  Ok  Button to Apply the Changes. Step-4  Click on  Close  button after windows completed the requested changes. Step-5  Go to the Search Bar and search for IIS. Step-6  A new window will open. Now,  right-click on Default Website > Then, go to Manage Website > Click on Browse option . Step-7  The following window will open:

Difference between Stored Procedure and Function in SQL Server

Difference between Stored Procedure and Function in SQL Server Stored Procedures are pre-compile objects which are compiled for first time and its compiled format is saved which executes (compiled code) whenever it is called. But Function is compiled and executed every time when it is called. For more about stored procedure and function refer the articles Different types of Stored Procedure and Different types of Function. Basic Difference 1.       Function must return a value but in Stored Procedure it is optional( Procedure can return zero or n values). 2.       Functions can have only input parameters for it whereas Procedures can have input/output parameters . 3.       Function takes one input parameter it is mandatory but Stored Procedure may take o to n input parameters.. 4.       Functions can be called from Procedure whereas Procedures cannot be called from Function. Adv...

Do you know why MVC is better than ASP.NET?

Why MVC is better than ASP.NET? ASP.net is the old standard for web forms. I know ASP.net mvc is a newer framework. ASP.net MVC was created in 2007 or 2008. The model-view-controller pattern tries to separate data, logic and the presentation of both to the user. That's one of the basic things they teach you in computer science. When you separate these layers, you can change the view based on the user's input without altering the presentation. AKA, changing buttons and menu options on a user's screen without losing the data they've put in because that is saved somewhere other than the life cycle workflow ASP.net uses. MVC lets you execute part of the code on the client, lessening demand on the server. And, sometimes, increasing response time as a result of the local processing. I had not heard that it increased performance. It can, but doesn't always. But MVC always has easier integration with JavaScript frameworks. And MVC is the standard of the stateless web, since...