Professional Documents
Culture Documents
Where would you use an iHTTPModule, and what are the limitations of any
approach you might take in implementing one?
Ans : One of ASP.NET's most useful features is the extensibility of the HTTP pipeline, the
path that data takes between client and server. You can use them to extend your ASP.NET
applications by adding pre- and post-processing to each HTTP request coming into your
application. For example, if you wanted custom authentication facilities for your
application, the best technique would be to intercept the request when it comes in and
process the request in a custom HTTP module..
How do you check whether the row data has been changed?
Ans : The definitive way to determine whether a row has been dirtied is to handle the
changed event for the controls in a row. For example, if your grid row contains a TextBox
control, you can respond to the control's TextChanged event. Similarly, for check boxes,
you can respond to a CheckedChanged event. In the handler for these events, you
maintain a list of the rows to be updated. Generally, the best strategy is to track the
primary keys of the affected rows. For example, you can maintain an ArrayList object that
contains the primary keys of the rows to update
Programmers understand that they're responsible for releasing any memory that they
allocate, but they're not very good at actually doing it. In addition, functions that allocate
memory as a side effect abound in the Windows API and in the C runtime library. It's
nearly impossible for a programmer to know all of the rules. Even when the programmer
follows the rules, a small memory leak in a support library can cause big problems if called
enough.
OBJECT:
What is the difference between Cookies collection and Form/Query string collection?
Cookie collection does not have the Count property. Cookies can have multiple values for
the same cookie name but each value can be referred using a key whereas in a
Form/Query string cookie each value has to be referred using an index value.
What is Collection?
Collection is a set of name/value pairs where the information supplied by the client is
stored
ASP 3.0
ASP .NET
• Supports a number of languages including Visual Basic, C#, and JScript
o code is compiled into .NET classes and stored to speed up multiple hits on a page
o object oriented and event driven makes coding web pages more like traditional
applications
• Files end with *.aspx extension
• .NET contains over 3400 classes
• XML-friendly data sets are used instead of recordsets
• Uses web forms that look like HTML forms to the client, but add much
functionality due to server-side coding
• Has built-in validation objects
• Improved debugging feature (great news for programmers)
• ASP .NET controls can be binded to a data source, including XML recordsets
Source: mikekissman.com
• An ASP.NET user control is a group of one or more server controls or static HTML
elements that encapsulate a piece of functionality. A user control could simply be an
extension of the functionality of an existing server control(s) (such as an image control
that can be rotated or a calendar control that stores the date in a text box). Or, it could
consist of several elements that work and interact together to get a job done (such as
several controls grouped together that gather information about a user's previous work
experience).
Source: 15seconds.com
Required entry RequiredFieldValidator Ensures that the user does not skip an entry.
Comparison to a value CompareValidator Compares a user's entry against a constant
value, or against a property value of another control, using a comparison operator (less
than, equal, greater than, and so on).
Range checking RangeValidator Checks that a user's entry is between specified lower and
upper boundaries. You can check ranges within pairs of numbers, alphabetic characters,
and dates.
Pattern matching RegularExpressionValidator Checks that the entry matches a pattern
defined by a regular expression. This type of validation allows you to check for predictable
sequences of characters, such as those in social security numbers, e-mail addresses,
telephone numbers, postal codes, and so on.
User-defined CustomValidator Checks the user's entry using validation logic that you write
yourself. This type of validation allows you to check for values derived at run time.
Source: MSDN
5. How will you upload a file to IIS in Asp and how will you do the same in ASP.net?
First of all, we need a HTML server control to allow the user to select the file. This is
nothing but the same old . This will give you the textbox and a browse
button. Once you have this, the user can select any file from their computer (or even from
a network). Then, in the Server side, we need the following line to save the file to the Web
Server.
myFile.PostedFile.SaveAs ("DestinationPath")
Attributes are a mechanism for adding metadata, such as compiler instructions and other
data about your data, methods, and classes, to the program itself. Attributes are inserted
into the metadata and are visible through ILDasm and other metadata-reading tools.
Attributes can be used to identify or use the data at runtime execution using .NET
Reflection.
Source: OnDotNet.com
8. What is the difference between server side and client side code?
Server code is executed on the web server where as the client code is executed on the
browser machine.
EnableViewState allows me to retain the values of the controls properties across the
requests in the same session. It hampers the performance of the application.
10. What is the difference between Server. Transfer and Response. Redirect?
The Transfer method allows you to transfer from inside one ASP page to another ASP
page. All of the state information that has been created for the first (calling) ASP page will
be transferred to the second (called) ASP page. This transferred information includes all
objects and variables that have been given a value in an Application or Session scope, and
all items in the Request collections. For example, the second ASP page will have the same
SessionID as the first ASP page.
When the second (called) ASP page completes its tasks, you do not return to the first
(calling) ASP page. All these happen on the server side browser is not aware of this.
The redirect message issue HTTP 304 to the browser and causes browser to got the
specified page. Hence there is round trip between client and server. Unlike transfer,
redirect doesn’t pass context information to the called page
ASP.NET Interview Questions with Answers - Set 1
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..
Are the actual permissions for the application defined at run-time or compile-time?
Ans : The CLR computes actual permissions at runtime based on code group
membership and the calling chain of the code..
4. What does the "EnableViewState" property do? Why would I want it on or off?
11. What are ASP.NET Web Forms? How is this technology different than
what is available though ASP (1.0-3.0)?
15. Describe the difference between inline and code behind - which is
best in a
17. Explain what a diffgram is, and a good use for one
18. Where would you use an iHTTPModule, and what are the limitations
of any
22. How would you get ASP.NET running in Apache web servers - why
would you even do this?
25. Which method do you invoke on the DataAdapter control to load your
generated dataset with data?
29. 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?
32 How do you turn off cookies for one page in your site?
34. What tags do you need to add within the asp:datagrid tags to bind
columns manually?
36. What tag do you use to add a hyperlink column to the DataGrid?
37. What is the standard you use to wrap up a call to a Web service
38. Which method do you use to redirect the user to another page
without performing a round trip to the client?
39. What is the transport protocol you use to call a Web service SOAP
42. What property do you have to set to tell the grid which page to go
to when using the Pager object?
43. Where on the Internet would you look for Web services?
44. What tags do you need to add within the asp:datagrid tags to bind
columns manually.
45. Which property on a Combo Box do you set with a column name, prior to setting
the DataSource, to display data in the combo box?
47. Which control would you use if you needed to make sure the values
in two different controls matched?
48. True or False: To test a Web service you must create a windows
application or Web application to consume this service?
Every application within an application pool shares the same worker process.
Because each worker process operates as a separate instance of the worker
process executable, W3wp.exe, the worker process that services one application
pool is separated from the worker process that services another. Each separate
worker process provides a process boundary so that when an application is
assigned to one application pool, problems in other application pools do not affect
the application. This ensures that if a worker process fails, it does not affect the
applications running in other application pools.
Use multiple application pools when you want to help ensure that applications and
Web sites are confidential and secure. For example, an enterprise organization
might place its human resources Web site and its finance Web site on the same
server, but in different application pools. Likewise, an ISP that hosts Web sites
and applications for competing companies might run each companys Web
services on the same server, but in different application pools. Using different
application pools to isolate applications helps prevent one customer from
accessing, changing, or using confidential information from another customers
site.
In HTTP.sys, an application pool is represented by a request queue, from which
the user-mode worker processes that service an application pool collect the
requests. Each pool can manage requests for one or more unique Web
applications, which you assign to the application pool based on their URLs.
Application pools, then, are essentially worker process configurations that service
groups of namespaces.
Multiple application pools can operate at the same time. An application, as
defined by its URL, can only be served by one application pool at any time. While
one application pool is servicing a request, you cannot route the request to
another application pool. However, you can assign applications to another
application pool while the server is running.