ASP.Net Questions
Q. Explain the differences between Server-side and Client-side code?
A. Server-side code executes on the server. Client-side code executes in
the context of the clients' browser.
Q. What are some ways to manage state in an ASP.Net application?
A. Session objects, Application objects, ViewState, cookies, hidden form fields.
Q. What does the "EnableViewState" property do? Why would I want it on or off?
A. It allows page objects to save their state in a Base64 encoded string in the page
HTML. One should only have it enabled when needed because it adds to the
page size and can get fairly large for complex pages with many controls.
(It takes longer to download the page).
Q. What is the difference between Server.Transfer and Response.Redirect? Why
would I choose one over the other?
A. Server.Transfer transfers excution directly to another page. Response.Redirect
sends a response to the client and directs the client (the browser) to load the
new page (it causes a roundtrip). If you don't need to execute code on the client,
Transfer is more efficient.
Q. How can I maintain Session state in a Web Farm or Web Garden?
A. Use a State Server or SQL Server to store the session state.
Q. What base class do all Web Forms inherit from?
A. The Page class.
Q. What does WSDL stand for? What does it do?
A.(Web Services Description Language). It describes the interfaces and
other information of a web service.
Q. Which WebForm Validator control would you use if you needed to make
sure the values in two different WebForm controls matched?
A. CompareValidator Control
Q. What property must you set, and what method must you call in your code,
in order to bind the data from some data source to the Repeater control?
A. You must set the DataSource property and call the DataBind method.
C# Questions
Q. Can you explain what inheritance is and an example of when you might use it?
A. Inheritance allows us to extend the functionality of a base class. It is an "Is a"
type of relationship rather than a "Uses" type of relationship (a dalmation IS A
dog which IS A canine which IS A mammal - dalmations inherist from dog which
inherits from canine which inherits from mammal). All child classes retain the
properties and methods of their parent classes but may override them. When you
want to inherit (use the functionality of) another class. Base Class Employee.
A Manager class could be derived from the Employee base class.
Q. Does C# support multiple-inheritance?
A. No, use interfaces instead.
Q. Can you prevent your class from being inherited by another class?
A. Yes. The keyword “sealed” will prevent the class from being inherited.
Q. What does the keyword “virtual” declare for a method or property?
A. The method or property can be overridden.
Q. What's the top .NET class that everything is derived from?
A. System.Object.
Q. What does it mean that a String is immutable?
A. Strings cannot be altered. When you alter a string (by adding to it for example),
you are actually creating a new string.
Q. If I have to alter a string many times, such as mutliple concatenations,
what class should I use?
A. StringBuilder. It is not immutable and is very efficient.
Q. In a Try - Catch - Finally block, will the finally block execute if an exception
has not occurred? If an Exception has occurred?
A. Yes and yes.
Q. Whats MSIL, and why should developers need an appreciation of it, if at all?
A. MSIL is the Microsoft Intermediate Language. All .NET compatible
languages will get converted to MSIL.
Q. Explain the three tier or n-Tier model.
A. Presentation (UI), business (logic and underlying code) and data
(from storage or other sources).
Q. What is SOA?
A. Service Oriented Architecture. In SOA you create an abstract layer that
your applications use to access various "services" and can aggregate the
services. These services could be databases, web services, message queues
or other sources. The Service Layer provides a way to access these services
that the applications do not need to know how the access is done. For example,
to get a full customer record, I might need to get data from a SGL Server
database, a web service and a message queue. The Service layer hides this from
the calling application. All the application knows is that it asked for a full
customer record. It doesn't know what system or systems it came from or
how it was retrieved.
Q. What is the role of the Data Reader class in ADO.NET connections?
A. It returns a forward-only, read-only view of data from the data source when
the command is executed.
Q. Is XML case-sensitive?
A. Yes.
Q. What is the CLR?
A. Common Language Runtime
Q. Can you explain some differences between an ADO.NET Dataset and
an ADO Recordset? (Or describe some features of a Dataset).
A. A DataSet can represent an entire relational database in memory,
complete with tables, relations, and views. A DataSet is designed to
work without any continuing connection to the original data source. Data in
a DataSet is bulk-loaded, rather than being loaded on demand. There's no
concept of cursor types in a DataSet. DataSets have no current record pointer
You can use For Each loops to move through the data. You can store many
edits in a DataSet, and write them to the original data source in a single operation.
Though the DataSet is universal, other objects in ADO.NET come in different
versions for different data sources
Q. Name some of the Microsoft Application Blocks. Have you used any?
Which ones?
A. Examples:
Exception Management
Logging
Data Access
User Interface
Caching Application Block for .NET
Asynchronous Invocation Application Block for .NET
Configuration Management Application Block for .NET
(there are others) We use Exception and Data Access
Showing posts with label .Net Interview Questions. Show all posts
Showing posts with label .Net Interview Questions. Show all posts
.Net And ASP.Net Questions
Explain the .NET architecture.
How many languages .NET is supporting now? - When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. The site DotNetLanguages.Net says 44 languages are supported.
How is .NET able to support multiple languages? - a language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.
How ASP .NET different from ASP? - Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.
Resource Files: How to use the resource files, how to know which language to use?
What is smart navigation? - The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.
What is view state? - The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. How? The values are encrypted and saved in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single control
Explain the life cycle of an ASP .NET page.
How do you validate the controls in an ASP .NET page? - Using special validation controls that are meant for this. We have Range Validator, Email Validator.
Can the validation be done in the server side? Or this can be done only in the Client side? - Client side is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.
How to manage pagination in a page? - Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.
What is ADO .NET and what is difference between ADO and ADO.NET? - ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.
.Net Questions
- Differences between DLL and EXE?
- Can an assembly have EXE?
- Can a DLL be changed to an EXE?
- Compare & contrast rich client (smart clients or Windows-based) & browser-based Web application
- Compare Client server application with n-Tier application
- Can a try block have more than one catch block?
- Can a try block have nested try blocks?
- How do you load an assembly at runtime?
- If I am writing in a language like VB or C++, what are the procedures to be followed to support .NET?
- How do you view the methods and members of a DLL?
What is shadowing? - What are the collections you’ve used?
- What is the base class of .NET?
- Explain assemblies.
- Name some of the languages .NET support?
- ADO.NET features? Benefits? Drawbacks?
- How many types of exception handlers are there in .NET?
- Difference between Panel and GroupBox classes?
- What is the base class of Button control?
- What is Response object? How is it related to ASP’s Response object?
- What is IIS? Have you used it?
- Main differences between ASP and ASP.NET.
Subscribe to:
Posts (Atom)