Skip to main content

Posts

Features of Interface

Features of Interface     An interface doesn't provide inheritance like a class or abstract class but it only declare members which an implementing class need to be implement.     It cannot be instantiated but it can be referenced by the class object which implements it. Also, Interface reference works just like object reference and behave like as object.         IStore IObjStore = new Document();         ICompress IObjCompress = new Document();     It contains only properties, indexers, methods, delegates and events signature.     It cannot contains constants members, constructors, instance variables, destructors, static members or nested interfaces.     Members of an interface cannot have any access modifiers even public.     Implicitly, every member of an interface is public and abstract. Also, you are not allowed to speci...

Features Of Abstract Class

Features of Abstract Class     An abstract class cannot be instantiated.     An abstract class contain abstract members as well as non-abstract members.     An abstract class cannot be a sealed class because the sealed modifier prevents a class from being inherited and the abstract modifier requires a class to be inherited.     A non-abstract class which is derived from an abstract class must include actual implementations of all the abstract members of parent abstract class.     An abstract class can be inherited from a class and one or more interfaces.     An Abstract class can has access modifiers like private, protected, internal with class members. But abstract members cannot have private access modifier.     An Abstract class can has instance variables (like constants and fields).     An abstract class can has constructors and destructor.     A...

WCF REST Note

Background Overview of REST REST stands for Representational State Transfer . This is a protocol for exchanging data over a distributed environment. The main idea behind REST is that we should treat our distributed services as a resource and we should be able to use simple HTTP protocols to perform various operations on that resource. When we talk about the Database as a resource we usually talk in terms of CRUD operations. i.e. Create, Retrieve, Update and Delete. Now the philosophy of REST is that for a remote resource all these operations should be possible and they should be possible using simple HTTP protocols. Now the basic CRUD operations are mapped to the HTTP protocols in the following manner: GET : This maps to the R(Retrieve) part of the CRUD operation. This will be used to retrieve the required data (representation of data) from the remote resource. POST : This maps to the U(Update) part of the CRUD operation. This protocol will update the c...

Passing Data from View to Controller Using Ajax Example Jquery

Jquery       $ ( '#btnSaveComments' ). click ( function () { var comments = $ ( '#txtComments' ). val (); var selectedId = $ ( '#hdnSelectedId' ). val (); $ . ajax ({ url : '<%: Url.Action("SaveComments")%>' , data : { 'id' : selectedId , 'comments' : comments }, type : "post" , cache : false , success : function ( savingStatus ) { $ ( "#hdnOrigComments" ). val ( $ ( '#txtComments' ). val ()); $ ( '#lblCommentsNotification' ). text ( savingStatus ); }, error : function ( xhr , ajaxOptions , thrownError ) { $ ( '#lblCommentsNotification' ). text ( "Error encountered while saving the comments." ); } }); });     Controller    [ HttpPost ] public ActionResult SaveComments ( int id , string com...

System.Web.Mvc Namespace

System.Web.Mvc Namespace Classes   Class Description AcceptVerbsAttribute Represents an attribute that specifies which HTTP verbs an action method will respond to. ActionDescriptor Provides information about an action method, such as its name, controller, parameters, attributes, and filters. ActionExecutedContext Provides the context for the ActionExecuted method of the ActionFilterAttribute class. ActionExecutingContext Provides the context for the ActionExecuting method of the ActionFilterAttribute class. ActionFilterAttribute Represents the base class for filter attributes. ActionMethodSelectorAttribute ...