ASP.NET MVC upload multiple files

In this article, we will learn how to upload multiple files using Asp.Net MVC and HTML 5. Upload multiple files using ASP.NET MVC HTML5 allows you to select and upload multiple files at the same time. Once the files are uploaded, you can process these using Asp.NET MVC. The view contains an HTML form with... » read more

ASP.Net MVC ViewData: Explaining ViewData with examples

You are wondering what is a viewData in MVC? In this tutorial, you will learn about ViewData objects and how we use them in ASP.NET Applications. What is ViewData in ASP.NET MVC? ViewData is an instance of the ViewDataDictionary class and is used to transfer data from the controller to view. It can be accessed... » read more

JavaScript Disable browser’s back button in ASP.Net

Web browsers enable users to go back to the previous page while browsing the internet by clicking on the back button. But sometimes, you need to prevent the user from visiting the previous page. You might want to disable the browser’s back button but you can’t disable the functionality through the code in the web... » read more

LINQ Aggregation methods in C#

Below are the most used aggregation functions in the Linq class with examples. First, add the namespaces as shown below: using System.Collections.Generic; using System.Linq; Now, create a list of type integer and assign a few variables to it. List<int> list = new List<int>() { 1, 2, 3, 4, 5 }; LINQ Sum Function It returns... » read more

C# List Examples

A list is a generic collection of items that can be accessed by index. You can access, search, sort, or manipulate the list items just like you can do with an Array. What is a list in C# The List is a class in the System.Collections.Generic namespace. It is a generic class that any type... » read more

Introducing Hooks in React

Hooks in React. The latest feature since React 16.8 Class-based components are a little bit complex but the only way to use states and lifecycles. You have to create a boilerplate code to maintain the states and bind functions, and then there are methods like componentDidMount, UnMount, etc. If you are creating a large app... » read more

React and PHP

How to use PHP with React to create a Feedback form So, let’s start from the basics. Creating the react app If you haven’t installed the create-react-app on your PC, you should install it. Go to your command prompt and enter the following commands to access your www directory. Now, enter npx create-react-app lesson17 lesson17... » read more

How to start, stop, and restart Windows Services using C#

Windows Services are a core part of the Windows Operating System which is responsible for creating and managing the long-running processes. In this article, we will learn how to start, stop, and restart a windows service using C# programming language. Starting a Windows Service using C# This method below will start the windows service “aspnet_state”... » read more

C# String Format for DateTime Overview

In this tutorial, we are going to use the method String.Format to format string for DateTime DataType. Format a String for DateTime using C# Example: DateTime dateTime = DateTime.Now; String date; date = String.Format("Date & Time Format: {0}", dateTime); Console.WriteLine(date); date = String.Format("Date Only Format: {0:D}", dateTime); Console.WriteLine(date); date = String.Format("Time Only Format: {0:T}", dateTime);... » read more

Convert String to Enum and Enum to string in C#

For example, we have the following enum: enum Days { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday } Convert enum string Use Enum.ToString method To convert an enumeration value to String. Days days = Days.Monday; string stringEnum = days.ToString(); Console.Write(stringEnum); Convert string to enum string strString = "Monday"; Days days = (Days)Enum.Parse(typeof(Days), strString); Or to... » read more

String.Format in C# for Decimal

In this article, we will learn how to use the String.Format function to format a string into Decimal number format. How to format a Double in C# using String.Format For example, if you have to format a number up to two decimal places, use a pattern that specifies two zeros after point such as 0.00.... » read more

C# FileStream: open, read, write files in C#

In .NET Framework, the System.IO namespace contains classes and functions that are used for file-related functionality, such as creating, reading, writing, updating, or closing a file. In this article, we will look at the FileStream class and its importance in WinForms applications. Using FileStream Class in C# for file operations It is a recommended programming... » read more

Introduction to File attributes in C#

In this article, we will learn about file attributes in C#, how to set or get file attributes, and the FileAttributes Enum. FileAttributes Enum The file Attributes is an Enum that contains attributes fields that can be set or get when dealing with files or directories. Here are the lists of the fields of the FileAttributes... » read more