Now a days in interview in C# this question is frequently ask that " What is the difference between ref and out parameter". In C#, a method can return only one value. If you like to return more than one value, you can use the ref & out keyword Here I will explain that....
Parameters are always passed by value to a method by default.If we want to pass them by reference then we can use either out or ref keyword.
Reference parameters basically never pass the value of a variable used in the method calling, instead they use the variable themselves. Rather than creating a new storage for that variable in the method declaration, the very same storage space is used, so the value of the variable in the member method and the value of the reference parameter will always be the same. Reference parameters require ref modifier as part of both the declaration and the calling.
Output parameters are very much like reference parameters. The variable specified at the time of calling doesn't need to have been assigned a value before it is passed to the called method. When the method is invoked completely we can read that variable as it is assigned by now.
Like reference parameters, output parameters don't create a new storage location, but use the storage location of the variable specified on the invocation. Output parameters need the out modifier as part of both the declaration and the invocation - that means it's always clear when you're passing something as an output parameter.
ASP.NET Web API is one of the most powerful recent addition to ASP.NET framework. Sometimes, you have to post a form data using jQuery-JSON to Web API or MVC method, which have so many input fields. Passing each and every input field data as a separate parameter is not good practice, even when you have a strongly typed-view. The best practice is, pass a complex type object for all the input fields to the server side to remove complexity.
Q1: Directives can be applied to which all element type?
Q2. What is notion of “isolate” scope object when creating a custom directive? How is it different from the normal scope object?
Memory management is the main concern for any application whether application is window based or web based. In .Net, CLR has garbage collector that executes as a part of our program and responsible for reclaiming the memory of no longer used objects. Garbage collector free the memory for objects that are no longer referenced and keeps the memory for future allocations.
.NET Framework provides two methods Finalize and Dispose for releasing unmanaged resources like files, database connections, COM etc. This article helps you to understand the difference between Finalize and Dispose method.
Now let’s have a look how Web server and IIS do things internally. Before we move ahead, you have to know about two main concepts
1. Worker Process
2. Application Pool
- Check for the
IsPostBackproperty to determine whether this is the first time the page is being processed.
- Create or recreate dynamic controls.
1. Controls Values and View state Values can access from Page_PreLoad event of Page Life Cycle.
2. Session value can be access from beginning of Page_PreInit event of Page Life Cycle.
Order to call Page Life Cycle Event :-