Sunday, December 30, 2018

Sql Server: how to change the state of database


In this article I am going to explain how to change the state (Read only to Read Write and vice versa) of Sql server database.

Description:
While working on window form application, I have face the issue of read only database on data insert.

Solution:
To resolve this issue we have 2 ways. One using Sql server management studio and 2nd one using Sql query.

Thursday, December 20, 2018

Asp.net MVC : Implement infinite scroll using Jquery

Here in this article I am going to explain how to implement infinite scroll using Jquery in asp.net MVC application.

Description:
I am showing list of country in application. Instead of pagination want to show all records on scroll. To fulfill this requirement I am using Jquery.

Implementation:

Model class:
   public partial class CountryMaster
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public string CountryCode { get; set; }
    }

Add Controller
Add an empty controller to project.

Complete source code of Controller:

MVC : Cascading DropdownList

Introduction: In this article today I am going to explain how we can Populate Cascading Dropdown List in Asp.net MVC4 using Json and Jquery
Populate Cascading Dropdown
(Click to Enlarge)
Description:

I want to populate State dropdown on Country selection and on State Dropdown Selection populate City dropdown. I have three classes in model CountryState and City.
Country:
using System.ComponentModel.DataAnnotations;

public class Country
    {
        [Key]
        public int CountryId { getset; }
        public string CountryName { getset; }

        public virtual ICollection<State> States { getset; }
    }

State:

Monday, August 6, 2018

Hello world application with Angular 6


Here in this tutorial I am going to explain how to create hello world application with Angular 6.

Prerequisite 

a.  Visual studio code
b.  Node.js

You can download the latest version of Visual studio code from here and Node.js from here.
Node.js installation will also install the npm. After installation start the visual studio code. If you see the message of Git is missing then you have to install the git to your system. You can download latest version here or in visual studio code  there is link in message to download git, when you click on the link it will redirect you to download link.

Sunday, April 15, 2018

How to change password in MVC application


In this article I am going to explain how to change password in MVC application. 

Description:
I want to add change password functionality for logged in users. To change password users have to enter current password, after that new password and confirm the new password.
  

Implementations:
Please check the previous post Create login form and maintain authenticated user’s detail in MVC application.

Model

Friday, March 16, 2018

How to generate numeric and alphanumeric OTP (one time password) in MVC application


Here in this article I am going to explain how to generate numeric and alphanumeric OTP (one time password) in MVC application.

Description:
I want to generate OTP. OTP can be numeric or alphanumeric and it is used widely to validate the user’s information such as mobile number, in banks for transaction etc.

Implementation:

Add controller
Add an empty controller to project. Create 3 action to generate OTP, one to generate numeric and 2nd one alphanumeric.

Monday, March 12, 2018

Generate random password in MVC application


In this article I am going to explain how to generate random password in MVC application.


Description:
I want to generate strong random password for users when they registers to website. Here in this article I am going to generate password using 2 ways.


Implementation:
Add an empty controller to project. I have create action Generatepassword.

  public ActionResult Generatepassword()
        {
            return View();
        }

Using Membership Generate method

ASP.NET MVC : Display data in 2 or more columns


In this article I am going to explain how to display data in 2 or more columns in MVC application.

Description:
I want to display data in 3 columns. To display data 2 or more columns we have 2 approaches. One use the Bootstarp, if use the bootstrap it adjust itself. 2nd one using the loop, run the loop and differentiate them like odd and even. For 2nd one check this article.

Implementation:
Model

Thursday, March 8, 2018

MVC : Generate random OTP (one time password)


In this article I am going to explain how to generate random OTP (one time password) in asp.net MVC application.

Description:
I want to generate OTP. OTP can be numeric or alphanumeric and it is used widely to validate the user’s information such as mobile number, in banks for transaction etc.

Implementation:

Add controller
Add an empty controller to project. Create 3 action to generate OTP, one to generate numeric and 2nd one alphanumeric.

Complete code of controller:

Friday, March 2, 2018

How to show data in 2 columns in MVC application


In this article I am going to explain how to show data in 2 columns in MVC application.

Description:
I am displaying list of all countries in MVC application one record per row but I want to display data in 2 columns. 2 records pre row.

Implementations:

Model

Wednesday, February 21, 2018

How to crop image using Iedit Jquery in MVC application

In this article I am going to explain how to crop image using Iedit Jquery and save to folder in MVC application.

Description:
In MVC application, want to add functionality to crop the image. When user’s uploading profile image, they can crop the uploaded image and it will be save to image folder. I am using IEdit Jquery plugin to crop the profile image. You can download the IEdit Jquery from here.

Implementation:
Add Controller:
Add an empty controller to project. Create action to upload profile pic.

Saturday, February 10, 2018

Convert Image to Base64 string and Base64 string to Image in asp.net MVC application

In this article I am going to explain how to convert Image to Base64 string and Base64 string to Image in asp.net MVC application.

Description:
In MVC application want to convert Image to Base64 and Base64 encoded string to Image.

Implementation:
Add empty controller to project. Create method to convert Image and Base64 encoded string.

Complete code to Controller :

Sunday, February 4, 2018

ASP.NET MVC : Crop image and save cropped image to folder

In this article I am going to explain how to crop image and save cropped image to folder in MVC using Jquery.

Description:
In MVC application, want to add functionality to crop the image. When user’s uploading profile image, they can crop the uploaded image and it will be save to image folder. I am using IEdit Jquery plugin to crop the profile image. You can download the IEdit Jquery from here.

Implementation:

Add Controller:

Tuesday, January 16, 2018

SQL SERVER : Create database from .MDF & .LDF file

In this article I am going to explain how to create database from .MDF & .LDF file in Sql server.

Description & Implementation:
I have .MDF and .LDF file of database. I want to restore or create database from these files. We have 2 ways to create database from .MDF and .LDF file.

Method 1: Using  T-Sql
Run the below given query :

Sunday, January 14, 2018

How to display username of logged in users in MVC application

In this artic article I am going to explain how to display username of logged in users in MVC application.

Description:
In MVC project I have created login form. After successfully logged in, want to show users name on top right hand side. I am using Tempdata to maintain the user’s detail.

Implementation:

Saturday, January 13, 2018

ASP.NET : Get Month name, number, year and number of days from given date

In this article I am going to explain how to get Month name, number, year and number of days from selected date in asp.net.


Description:
I want to get the month name, number, year and number of days in selected month.

Implementation:

HTML markup of webform:

Tuesday, January 9, 2018

Create login form and maintain authenticated user’s detail in MVC application

In this artic article I am going to explain how to create login form and maintain authenticated user’s detail in MVC application.

Description:
I want to create login form and maintain the authenticated user’s detail in application. I am using Tempdata to maintain the user’s detail.

Implementation:

Model:

Sunday, January 7, 2018

Check Password strength using Jquery in MVC application

In this article I am going to explain how to check Password strength using Jquery in MVC application. 

Description:
I want to show the strength of password entered by users or admin. I am using Jquery to show password’s strength.

Implementation: