Authentication and Authorization in Asp.Net MVC

Here  i will explain how to add custom Authentication and Authorization in Asp.Net MVC. Before start we need to know what is Authentication and Authorization. Authentication deals with user account validation. It’s a process to checks the user is valid or not and this user registered in our application or not. e.g.: Login. Authorization deals with user […]

Read More

How does Data Binding work in AngularJS?

AngularJS remembers the value and compares it to a previous value. This is basic dirty-checking. If there is a change in value, then it fires the change event. The $apply() method, which is what you call when you are transitioning from a non-AngularJS world into an AngularJS world, calls $digest(). A digest is just plain […]

Read More

Remove blank node from XML string

Example: public string UpdateXMLString() { string xmlstr = “<detail><FirstName>John</FirstName><LastName></LastName><age>0</age><mobile>0</mobile><address>0</address><address2>aaa</address2></detail>”; XmlDocument xdoc = new XmlDocument(); XmlDocument xdoc2 = new XmlDocument(); // Creat XML object to store result xdoc.LoadXml(xmlstr); XmlNodeList xn = xdoc.LastChild.ChildNodes; int totalnode = xn.Count; // Total no. of nodes for (int i = 0; i < totalnode; i++) { if (xn[i].InnerText == “0” || […]

Read More

SOLID Design Principles in C#

SOLID are five basic principles which help to create good software architecture. SOLID is an acronym where:- S stands for SRP (Single responsibility principle) O stands for OCP (Open closed principle) L stands for LSP (Liskov substitution principle) I stands for ISP ( Interface segregation principle) D stands for DIP ( Dependency inversion principle)

Read More

Electronic Benefits Transfer

Electronic Benefits Transfer (EBT) EBT stands for Electronic Benefit Transfer. It is the new method being used to deliver food stamp benefits. In some counties, it will also be used to Deliver CalWORKs, General Assistance/Relief and Refugee Cash Assistance to People receiving public assistance benefits.   How does it work? People receiving food stamp benefits […]

Read More

What is POCO in Entity Framework?

POCOS(Plain old CLR objects) are simply entities of your Domain.Normally when we use entity framework the entities are generated automatically for you.This is great but unfortunately these entities are interspersed with database access functionality which is clearly against the SOC(Separation of concern).POCOS are simple entities without any data access functionality but still gives the capabilities […]

Read More

Generate random number using Linq

In below example, we will show how to generate random number using Linq in C# public static string RandomString(int length) { const string chars = “ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789”; var random = new Random(); return new string(Enumerable.Repeat(chars, length) .Select(s => s[random.Next(s.Length)]).ToArray()); }

Read More

Change default date time format in gridview

Use this DataFormatString=”{0:d}” If in gridview you are getting date format something like 11 march 2016 12:00:00(or default format) Example:- <asp:BoundField DataField=”SNAPSHOT_DATA_DATE” HeaderText=”Snapshot Date” ApplyFormatInEditMode=”true” SortExpression=”SNAPSHOT_DATA_DATE” DataFormatString=”{0:d}” />

Read More

AngularJS in ASP.NET MVC and Entity Framework

Now a days, everybody is discussing about using AngularJS in ASP.NET MVC. So in this post we will figure out how to use the best of both goodness with an example creating a project in ASP.Net MVC using AngularJS. Later in the post, we will discuss how to post and fetch data using Entity Framework […]

Read More

AimBeyond

AimBeyond Location : Sec 62, Noida, 201301, India There are following question which i have faced in interview at AimBeyond company What is Dependency Injection What do you mean by SPA(Single page application) What is $scope What is Directives in AngularJS What is Filters in AngularJS How to handle role based authorization in AngularJS Differentiate between […]

Read More

State management in ASP.Net

State management means to preserve state of a control, web page, object/data, and user in the application explicitly because all ASP.NET web applications are stateless, i.e., by default, for each page posted to the server, the state of controls is lost. Nowadays all web apps demand a high level of state management from control to […]

Read More

Grid in MVC Using Grid.MVC

In ASP.NET MVC, the new concept begins MVC Grid. MVC Grid is lightweight for showing data in tabular format like GridView in Asp.net. Here i will explain how to use MVC Grid in asp.net MVC with entity framework. In below HomeController, we are passing user details data to view. public class HomeController : Controller { […]

Read More

Program to check the number is palindrome or not.

A palindromic number or numeral palindrome is a number that remains the same when its digits are reversed. Like 16461, for example, it is “symmetrical”. The term palindromic is derived from palindrome, which refers to a word (such as rotor or racecar) whose spelling is unchanged when its letters are reversed. Example:   class Program […]

Read More