Tuesday 8 September 2015

ASP.NET Interview Question And Answer

ASP.NET Interview Question And Answer      1)What is Asp?      Ans. Active Server Pages (ASP), also known as Classic ASP, is a ... thumbnail 1 summary


ASP.NET Interview Question And Answer

     1)What is Asp?
     Ans.
Active Server Pages (ASP), also known as Classic ASP, is a Microsoft's server-side technology, which helps in creating dynamic and user-friendly Web pages. It uses different scripting languages to create dynamic Web pages, which can be run on any type of browser. The Web pages are built by using either VBScript or JavaScript and these Web pages have access to the same services as Windows application, including ADO (ActiveX Data Objects) for database access, SMTP (Simple Mail Transfer Protocol) for e-mail, and the entire COM (Component Object Model) structure used in the Windows environment. ASP is implemented through a dynamic-link library (asp.dll) that is called by the IIS server when a Web page is requested from the server.

2)What is Asp.net?
Ans.
ASP.NET is a specification developed by Microsoft to create dynamic Web applications, Web sites, and Web services. It is a part of .NET Framework. You can create ASP.NET applications in most of the .NET compatible languages, such as Visual Basic, C#, and J#. The ASP.NET compiles the Web pages and provides much better performance than scripting languages, such as VBScript. The Web Forms support to create powerful forms-based Web pages. You can use ASP.NET Web server controls to create interactive Web applications. With the help of Web server controls, you can easily create a Web application.


3) Explain ASP.NET Web Forms.

-> Web Forms are an extremely important part of ASP.NET.
-> They are the User Interface (UI) elements which provide the desired look and feel to your web applications.
-> Web Forms provide properties, methods, and events for the controls that are placed onto them.



4)What is the concept of Postback in ASP.NET?
Ans.
A postback is a request sent from a client to server from the same page user is already working with.

ASP.NET was introduced with a mechanism to post an HTTP POST request back to the same page. It's basically posting a complete page back to server (i.e. sending all of its data) on same page. So, the whole page is refreshed.


5)Difference between Asp And Asp.net?
Ans.
Asp.net
1.Provide code behind file which contains all event handling code.
2.support Inheritance.
3.support programming language.
4.provide configuration files
5.support custom controls.
6.asp.net page is compiled when executed.
7.provide server and html control.
8.asp.net has a inbuilt facility of validation control.
Asp.
1.does not have such file to separate programming logic from design.
2.does not support inheritance.
3.support scrip language.
4.does not provide ant configuration file.
5.does not support custom control.
6.Asp page are interpreted when page is executed.
7.does not provide server controls.
8.Asp has no inbuilt facility for validation of controls.

6)Difference between Abstract and Interface?
Ans.
Abstract Class:
1.Abstract method does not contain any definition-Abstract class provides a set of rules to implement next class
2.If a class contains at least one abstract method then it must be declared as an “Abstract Class”
3.While inheriting abstract class all abstract methods must be override
4.Abstract classes are also called as “Partial abstract classes”
5.Partial abstract class may contain functions with body and functions without body
6.If a class contains all functions without body then it is called as “Fully Abstract Class”
Interface:
1.If a class contains all abstract methods then that class is known as “Interface”
2.Interfaces support like multiple inheritance
3.In interface all methods are public abstract by default
4.Interfaces can be instantiated, but a reference cannot be created 

7)Describe state management in ASP.NET.

              State management is a technique to manage a state of an object on different request.
              The HTTP protocol is the fundamental protocol of the World Wide Web. HTTP is a stateless protocol means every request is from new user with respect to web server. HTTP protocol does not provide you with any method of determining whether any two requests are made by the same person.
             Maintaining state is important in any web application. There are two types of state management system in ASP.NET.
            - Client-side state management
            - Server-side state management

8)Explain client side state management system.

ASP.NET provides several techniques for storing state information on the client. These include the following:
1)view state ASP.NET uses view state to track values in controls between page requests. It works within the page only. You cannot use view state value in next page.
2)control state: You can persist information about a control that is not part of the view state. If view state is disabled for a control or the page, the control state will still work.
3)hidden fields: It stores data without displaying that control and data to the user’s browser. This data is presented back to the server and is available when the form is processed. Hidden fields data is available within the page only.
4)Query strings: In query strings, values are stored at the end of the URL. These values are visible to the user through his or her browser’s address bar. Query strings are not secure. You should not send secret information through the query string. 

5)Cookies:Cookies are small piece of information that server creates on the browser. Cookies store a value in the user’s browser that the browser sends with every page request to the web server.


9)Explain server side state management system.

The following objects are used to store the information on the server:
1)Application State:
This object stores the data that is accessible to all pages in a given Web application. The Application object contains global variables for your ASP.NET application. 
2)Session State: Session object stores user-specific data between individual requests. This object is same as application object but it stores the data about particular user. 

3)Cache Object: Caching is the process of storing data that is used frequently by the user. Caching increases your application’s performance, scalability, and availability. You can catch the data on the server or client. 

10)What are differences between function and stored procedure?

Ans:

1) Function returns only one value but procedure returns one or more than one value.

2) Function can be utilized in select statements but that is not possible in procedure.

3) Procedure can have an input and output parameters but function has only input parameters only.

4) Exceptions can be handled by try catch block in procedures but that is not possible in function.

11)Difference between Client-side and server-side validations in Web pages.

-> Client-side validations happends at the client's side with the help of JavaScript and VBScript. This happens before the Web page is sent to the server.
-> Server-side validations occurs place at the server side.

12)Difference between Authentication and authorization.

-> Authentication is the process of verifyng the identity of a user using some credentials like username and password while authorization determines the parts of the system to which a particular identity has access.
-> Authentication is required before authorization. 

13) Differentiate between a HyperLink control and a LinkButton control.

-> A HyperLink control does not have the Click and Command events
-> LinkButton control has them, which can be handled in the code-behind file of the Web page.
 


14)What are difference between GET and POST Methods?

Ans:
GET Method (): 
1) Data is appended to the URL.
2) Data is not secret.
3) It is a single call system
4) Maximum data that can be sent is 256.
5) Data transmission is faster
6) this is the default method for many browsers


POST Method (): 

1) Data is not appended to the URL.
2) Data is Secret
3) it is a two call system.
4) There is no Limit on the amount of data. That is characters any amount of data can be sent.
5) Data transmission is comparatively slow.
6) No default and should be explicitly specified.

15)What are the various types of validation controls provided by ASP.NET?

ASP.NET provides 6 types of validation controls as listed below:

1) RequiredFieldValidator - It is used when you do not want the container to be empty. It checks if the control has any value or not.

2) RangeValidator - It checks if the value in validated control is within the specified range or not.

3) CompareValidator - Checks if the value in controls matches some specific values or not.

4) RegularExpressionValidator - Checks if the value matches a specific regular expression or not.

5) CustomValidator - Used to define User Defined validation.

6) Validation Summary -Displays summary of all current validation errors on an ASP.NET page.
 

No comments

Post a Comment