What is Option Strict used for?

Option Strict On enables type checking at design time andprevents type mismatch bugs.

What is the transport protocol you use to call a Web service?

SOAP (Simple Object Access Protocol) is the preferred protocol. 

how does the cookies work in asp.net?

we know Http is an state-less protocol which is required for interaction between clinet and server .

so there is an need to remeber state of request raised by an web browser so that
web server can recognize you have already previously visited or not.

There are two types of state management techniques:
a) Client side state management
b) Server - side statemanagement

Using cookies comes under clinet side statemanagement .In HttpResponse we write
Cookie containing sessionId and other information within it.

when a browser made a request to the web server the same cookie is sent to the server where server recognize the session id and get other information stored to it previously.

How do you apply Themes to an entire application?

By specifying the theme in the web.config file.
Eg: <configuration>
<system.web>
<pages theme=”BlueMoon” />
</system.web>
</configuration>

Which dll handles the request of .aspx page?

When the Internet Information Service process (inetinfo.exe) receives an HTTP request, it uses the filename extension of the requested resource to determine which Internet Server Application Programming Interface (ISAPI) program to run to process the request. When the request is for an ASP.NET page (.aspx file), IIS passes the request to the ISAPI DLL capable of handling the request for ASP.NET pages, which is aspnet_isapi.dll.

What is marshalling? Explain types of marshalling.

Marshaling is a process of transforming or serializing data from one application domain and exporting it to another application domain.
Two types of marshalling

  • Marshal by value: a copy of an object is created by the server and is passed and used by the client.
  • Marshal by reference: the client creates a proxy to access the object.

singleton architecture of Remoting -

Singleton architecture is to be used when all the applications have to use or share same data.

What is an application domain

It's a way in CLR to maintain a boundary between various applications to ensure that they do not interfere in working of any other application. CLR acts as a mini operating system where a single process may have various application domains.

  • An operating system process can have many ongoing application domains. Application Domains keep an application separate.
  • All objects created within the same application scope are created within the same application domain.
  • Multiple application domains can exist in a single operating system process,
  • Distinct memory address space allocation by the OS is effective but expensive and it does not satisfy to the numbers required for large web servers.
  • However, the CLR isolates an application by managing the memory use of code running within the application domain due to which the code cannot access memory outside the boundaries of the domain.

What is the Pre-Compilation feature of ASP.NET 2.0

Previously, in ASP.NET, the pages and the code used to be compiled dynamically and then cached so as to make the requests to access the page extremely efficient. In ASP.NET 2.0, the pre-compilation feature is used with which an entire site is precompiled before it is made available to users.
 There is a pre-defined folder structure for enabling the pre-compilation feature:
  • App_Code: stores classes
  • App_Themes: stores CSS files, Images, etc.
  • App_Data: stores XML files, Text Files, etc.
  • App_GlobalResources: stores all the resources at global level E.g. resx files, etc
  • App_LocalResources: stores all the resources at local/Page level

What is the 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. There are other type of resources than Web pages, but that's the easiest conceptually. 
A URI is a unique identifier to usually a namespace.
Though it looks like a URL but it doesn’t have to necessarily locate any resource on the web.
URI is a generic term. URL is a type of URI.

______________
URI - Uniform Resource Identifier: it’s a string and its responsibility is to identify a resource by meta-information. It gives information about only one resource.
URL - Uniform Resource Locator: identifies the resource on the net and tells it is obtainable using what protocols.

Difference between src and Code-Behind

Src: is a way mention the name of the code-behind class to dynamically compile on the request for a page.
Code-behind: is the logic written behind the UI design file. It specifies the name of the compiled file that contains the class. Code-behind attribute is only used for.Net.

What is a ViewState?

Viewstate is used to maintain or retain values on postback. It helps in preserving a page. Viewstate is internally maintained as a hidden field in encrypted form along with a key.
Advantages:
i) No server resources.
ii) Viewstate ensures security because it stores the data in encrypted format.
iii) Viewstates are simple. They are used by enabling or disabling the viewstate properties.
iv) It is based on the wish of developer that they want to implement it at the page level or at control level.
Disadvantages:
i) If large amount of data is stored on the page, then page load might cause a problem.
ii) Does not track across pages. Viewstate information does not automatically transfer from page to page.

How to pass a querystring from an .asp page to aspx page

Consider the following URL:

http:// localhost/form.aspx?param1=career&param2=ride
This html addresses use QueryString property to pass values between pages.
From the URL above the information obtained is:
form.aspx: which is the destination page for your browser.
Param1 is the first parameter, the value of which is set to career
Param2 is the first parameter, the value of which is set to ride
The ‘?’ marks the beginning of the QueryString
‘&’ is used as a separator between parameters.
private void formButtonSubmit_Click(object sender, System.EventArgs e)
{
Response.Redirect("form.aspx?Param1=" +
this.formTextfieldParam1.Text + "&Param2=" +
this. formTextfieldParam2.Text);
}
The above code is a submit button event handler and it sends the values of the query string to the second page.
The following code demonstrates how to retrieve these valus on the second page:
private void Page_Load(object sender, System.EventArgs e)
{
      this.form2TextField1.Text = Request.QueryString["Param1"];
      this. form2TextField2.Text = Request.QueryString["Param2"];
}

You can also use the following method to retrieve the parameters in the string:

for (int i =0;i < Request.QueryString.Count;i++)
{
        Response.Write(Request.QueryString[i]);
}

From HTML in asp page: <ahref="abc.aspx?qstring1=test">Test Query String</a>
From server side code: <%response.redirect "webform1.aspx?id=11"%>

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.
The keyword partial must appear in each class.

//syntax for C#
Public partial class MyPartialClass1
{
         //code
}
// this code could be in file1
Public partial class MyPartialClass1
{
         //code
}
// this code could be in file2

___________________
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 refers to the caching of individual user controls within a Web Form. 
  • Each user control can have independent cache durations and implementations of how the caching behavior is to be applied.
  • Fragment caching is useful when you need to cache only a subset of a page. 
  • Navigation bars, header, and footers are good candidates for fragment caching.

What is the difference between login controls and Forms authentication?

  • Forms authentication can be easily implemented using login controls without writing any code.
  • Login control performs functions like prompting for user credentials, validating them and issuing authentication just as the FormsAuthentication class.
  • However, all that’s needs to be dne is to drag and drop the use control from the tool box to have these checks performed implicitly. 
  • The FormsAuthentication class is used in the background for the authentication ticket and ASP.NET membership is used to validate the user credentials.

What are the advantages and disadvantages of a layered architecture

The following are the advantages of a layered architecture:
Layered architecture increases flexibility, maintainability, and scalability. In a Layered architecture we separate the user interface from the business logic, and the business logic from the data access logic. Separation of concerns among these logical layers and components is easily achieved with the help of layered architecture.

Multiple applications can reuse the components. For example if we want a windows user interface rather than a web browser interface, this can be done in an easy and fast way by just replacing the UI component. All the other components like business logic, data access and the database remains the same. Layered architecture allows to swap and reuse components at will.
Layered architecture enables teams to work on different parts of the application parallely with minimal dependencies on other teams.
Layered architecture enables develop loosely coupled systems.
Different components of the application can be independently deployed, maintained, and updated, on different time schedules.


Layered architecture also makes it possible to configure different levels of security to different components deployed on different boxes. sO Layered architecture, enables you to secure portions of the application behind the firewall and make other components accessible from the Internet.
Layered architecture also helps you to test the components independently of each other.


The following are the disadvantages of a layered architecture:                
There might be a negative impact on the performance as we have the extra overhead of passing through layers instead of calling a component directly.
Development of user-intensive applications can sometime take longer if the layering prevents the use of user interface components that directly interact with the database.
The use of layers helps to control and encapsulate the complexity of large applications, but adds complexity to simple applications.
Changes to lower level interfaces tend to percolate to higher levels, especially if the relaxed layered approach is used.