Skip to main content

Posts

Showing posts from March, 2017

#MVC Authorize Attribute

Authorization is the process of determining the rights of an authenticated user for accessing the application's resources. The Asp.Net MVC Framework has a AuthorizeAttribute filter for filtering the authorized user to access a resource. Authorize Attribute Properties Properties Description Roles Gets or sets the roles required to access the controller or action method. Users Gets or sets the user names required to access the controller or action method. Filtering Users by Users Property Suppose you want to allow the access of AdminProfile to only shailendra and mohan users then you can specify the authorize users list to Users property as shown below. [ Authorize ( Users = "Raj,Deena,Siva,Gow" )] public ActionResult AdminProfile () { return View (); } Filtering Users by Roles Property Suppose you want to allow the access of AdminProfile action to only Admin and SubAdmin roles then you can specify the authorize roles...

#.Net Globalization and Localization

What is Globalization and Localization? Globalization is the process of designing the application in such a way that it can be used by users from across the globe (multiple cultures). Localization, on the other hand, is the process of customization to make our application behave depending on the current culture and locale. These two things go together.

#Framework Net Architecture and .Net Framework basics

What is the .NET Framework? The .NET Framework is a new and revolutionary platform created by Microsoft for developing   applications .    It is a platform for application   developers . It is a Framework that supports Multiple Language and Cross language integration. IT has IDE (Integrated Development Environment). Framework is a set of utilities or can say building blocks of your application system. .NET Framework provides GUI in a GUI manner. .NET is a platform independent but with help of Mono Compilation System (MCS). MCS is a middle level interface. .NET Framework provides inter-operability between languages i.e. Common Type System (CTS) . .NET Framework also includes the .NET Common Language Runtime (CLR), which is responsible for maintaining the execution of all applications developed using the .NET library. The .NET Framework consists primarily of a gigantic library of code. Definition:  A programming infrastructur...

#c# extension methods

What are extension methods? Extension methods enable you to add methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type.  An extension method is a special kind of static method, but they are called as if they were instance methods on the extended type. How to use extension methods? An extension method is a static method of a static class, where the "this" modifier is applied to the first parameter. The type of the first parameter will be the type that is extended. Extension methods are only in scope when you explicitly import the namespace into your source code with a using directive. public static class MyExtension {         public static string ToMyStandard (this string stdString)         {             return "MYSTR-" + stdString;         }     }  string ss = "data";  @ViewBag.MyData = ...