• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

Asp.Net Interview Questions Answers

Question - 21 : - How can you provide an alternating color scheme in a Repeater control?

Answer - 21 : - Use the AlternatingItemTemplate.

Question - 22 : - What are the advantages and  disadvantages of viewstate?

Answer - 22 : -   The primary advantages of the ViewState feature in ASP.NET are: 1. Simplicity. There is no need to write possibly complex code to store form data between page submissions. 2. Flexibility. It is possible to enable, configure, and disable ViewState on a control-by-control basis, choosing to persist the values of some fields but not others. There are, however a few disadvantages that are worth pointing out: 1. Does not track across pages. ViewState information does not automatically transfer from page to page. With the session approach, values can be stored in the session and accessed from other pages. This is not possible with ViewState, so storing data into the session must be done explicitly. 2. ViewState is not suitable for transferring data for back-end systems. That is, data still has to be transferred to the back end using some form of data object.

Question - 23 : - What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState?

Answer - 23 : -   ViewState is the mechanism ASP.NET uses to keep track of server control state values that don't otherwise post back as part of the HTTP form. ViewState Maintains the UI State of a Page   ViewState is base64-encoded.  It is not encrypted but it can be encrypted by setting EnableViewStatMAC="true" & setting the machineKey validation type to 3DES.  If you want to NOT maintain the ViewState, include the directive < %@ Page EnableViewState="false" % > at the top of an .aspx page or add the attribute EnableViewState="false" to any control.

Question - 24 : - Explain the differences between Server-side and Client-side code?

Answer - 24 : -   Server side scripting means that all the script will be executed by the server and  interpreted as needed. ASP doesn't have some of the functionality like sockets, uploading,  etc. For these you have to make a custom components usually in VB or VC++. Client side  scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in  VBScript or JavaScript. Download time, browser compatibility, and visible code - since  JavaScript and VBScript code is included in the HTML page, then anyone can see the code by viewing the page source. Also a possible security hazards for the client computer.

Question - 25 : - Name the validation control available in asp.net?.

Answer - 25 : -   RequiredField, RangeValidator,RegularExpression,Custom validator,compare Validator

Question - 26 : - . What's a bubbled event?

Answer - 26 : -   When you have a complex control, likeDataGrid, writing an event processing routine for each object (cell, button,row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents. Suppose you want a certain ASP.NET function executed on MouseOver over a certain button.

Question - 27 : - Whats an assembly?

Answer - 27 : - Assemblies are the building blocks of the .NET framework.

Question - 28 : - Should validation (did the user enter a real date) occur server-side or client-side? Why? 

Answer - 28 : - It should occur both at client-side and Server side.By using expression validator control with the specified expression ie.. the regular expression provides the facility of only validatating the date specified is in the correct format or not. But for checking the date where it is the real data or not should be done at the server side, by getting the system date ranges and checking the date whether it is in between that range or not.

Question - 29 : -   What is the difference between Value Types and Reference Types?

Answer - 29 : -   Value Types uses Stack to store the data where as the later uses the Heap to store the data.  

Question - 30 : - What are the Application_Start and Session_Start subroutines used for?

Answer - 30 : - This is where you can set the specific variables for the Application and Session objects.

Computer Contributors

Rajeev Katiyar
Yes Baroda

Share your email for latest updates


Our partners