What is difference between URL and URI?

  • A URL (Uniform Resource Locator) is the address of some resource on the Web. A resource is nothing but a page of a site. It gives absolute path of the current page or image i.e. perfect location of the page or image.
  • While URI is Uniform Resource Identifier looks like a URL but it doesn’t have to necessarily locate any resource on the web. Like this string may have querystring and other things.

What is Satellite Assembly?

Satellite Assemblies are language-specific assemblies and are used for language-specific resources for an application. Each assembly of this kind has a separate language specific ID and is installed in a language-specific subdirectory for each language.

Explain the concepts of Post Cache Substitution in .NET

Post Cache Substitution works opposite to fragment caching.

The entire page is cached, except what is to be kept dynamic. When [OutputCache] attribute is used, the page is cached on both the server and the client. Whereas, you use in case of post cache substitution the page is cached on the server only. HttpResponse.WriteSubstitution method is a way to implement it.

Explain how to access ViewState value of this page in the next page.

PreviousPage property is set to the page property of the nest page to access the viewstate value of the page in the next page.
Page poster = this.PreviousPage;
Once that is done, a control can be found from the previous page and its state can be read.
Label posterLabel = poster.findControl("myLabel");
string lbl = posterLabel.Text;

What is partial classess in .net?

  • When there is a need to keep the business logic separate from the User Interface or when there is some class which is big enough to have multiple number of developers implement the methods in it, the class can be separated and written in different files as partial class.
  • Partial classes allow us to divide the class definition into multiple files (physically). Logically, all the partial classes are treated as a single file by the compiler.

What is Fragment Caching in ASP.NET?

Fragment caching allows to cache specific portions of the page rather than the whole page. It is done by implementing the page in different parts by creating everything in form of user controls and caching each user control individually.

Difference between Server-Side AJAX framework and Client-side AJAX framework?

  • ASP.NET AJAX contains both a server-side Ajax framework and a client-side Ajax framework. The server-side framework provides developers with an easy way to implement Ajax functionality, without having to possess much knowledge of JavaScript. The framework includes server controls and components and the drag and drop functionality. This framework is usually preferred when you need to quickly ajaxify an asp.net application. The disadvantage is that you still need a round trip to the server to perform a client-side action.
  • The Client-Side Framework allows you to build web applications with rich user-interactivity as that of a desktop application. It contains a set of JavaScript libraries, which is independent from ASP.NET. The library is getting rich in functionality with every new build released.

What is the Difference between imperative and interrogative code?

Some methods return values or provide information back to the calling code. These are called interrogative methods.Others, called imperative methods, just perform a service and return nothing to the calling code.
In VB.NET, methods are implemented using Sub (for imperative methods) or Function (for interrogative methods) routines within the class module that defines our object. Sub routines may accept parameters, but they don't return any result value when they are complete. Function routines can also accept parameters, and they always generate a result value that can be used by the calling code.

Difference between Public, Protected, Protected Friend, Private, Friend.

These term determine the visiblity of any classes, properties, or methods you declare.

Public : Declaring a class as Public means you can "see" and instantiate this class in any other classes or subroutines within the same assembly. If you've compiled it into a DLL, referencing assemblies can see it, as well. Declaring a Public Sub / Function or Property means that when its container class is instantiated, the consumer can also see the method or property.

 Private : Private limits the visiblity to a scope. Declaring a private class within a class means that "sub-class" can't be seen from outside of the class. This is also true for methods and properties - they can be seen within the class, but not to any consumers or inheritors.

Protected : This will more likely apply to methods and properties; they won't necessarily be seen outside of the class in which they're declared. However, if a class inherits the container class, that inheritor can see the protected members.

Friend : This applies to classes, methods, and properties. They can be seen within the assembly, but not to any referencing assemblies or even inheritors. (This is the equivalent of "internal" in C#).

 Protected Friend : This is what it seems; classes, methods, and properties declared with this can be seen both within the assembly, as well as by inheritors. They cannot be seen from referencing assemblies. (This is "protected internal" in C#).

What is the difference between "Web.config" and "Machine.Config"?

"Web.config" files apply settings to each web application, while "Machine.config" file apply settings to all ASP.NET applications.

How do we assign page specific attributes?

Page attributes are specified using the @Page directive.

How do we ensure view state is not tampered?

Using the @Page directive and setting 'EnableViewStateMac' property to True.

What is event bubbling?

Server controls like Data grid, Data List, and Repeater can have other child controls inside them. Example Data Grid can have combo box inside data grid. These child control do not raise there events by themselves, rather they pass the event to the container parent (which can be a data grid, data list, repeater), which passed to the page as "ItemCommand" event. As the child control send events to parent it is termed as event bubbling.