Sunday, March 22, 2009
ASP DOT NET - Objective Questions
ASP Dot Net
1) Which of the following statements about ASP & ASP.Net are correct?,
i. ASP is Interpreted where ASP.Net is compiled language.
ii. HTML statements can easily be inserted within functions in ASP where ASP.Net requires "Response.write"
iii. Functions in ASP.Net must appear in a <script runat=server> with Language declared.
iv. The function calls in ASP.Net require parentheses() appear after the function name.
I need help
2) ASP.Net allows switching between VBScript and JavaScript with in a page. Is this correct?
I need help
3) Controls in ASP and ASP.Net are Server side controls. Is this correct?
I need help
4) On which of the following events/methods during the life cycle of an ASP.Net application, the tasks like loading data to cache, initializing static data should be done for better results?
i. Application_Start
ii. Application_BeginRequest
iii. Application_EndRequest
iv. Application_Error
v. HttpApplication.Init
vi. Dispose
vii. Application_End
I need help
5) Any class that implements the IHttpHandler interface can act as a target for the incoming HTTP requests. Is this correct?
I need help
6) Which of the following events is registered by an HTTP module when ASP.Net runtime receives a new HTTP request?
i. AcquireRequestState
ii. AuthenticateRequest
iii. AuthorizeRequest
iv. BeginRequest
I need help
Conclusions...
1. ASP is interpreted language, ASP.Net is compiled language. One of the strengths of ASP was to easily drop functions into existing HTML pages without much re-coding. ASP.Net requires any HTML that appears within functions to be written to the screen using the response.write function. Have a look in to the below codes,
ASP:
<%
Function Hello()
For iDx=1 to 5
%>
<font size=<% =iDx %>>Hello</font>
<%
Next
End Function
Hello
%>
ASP.Net:
<%
Function Hello()
For iDx=1 to 5
Response.write("<font size="& iDx &"> Hello </font>")
Next
End Function
Hello()
%>
It's clear now
2. One of the large difference between ASP and ASP.Net is ASP.Net doesn't contain the capablity to have multiple languages on a single page. This means we cannot switch from VBScript to JavaScript and then back again. However we still have different languages on different pages within the same application.
It's clear now
3. No controls on Server side in ASP, all are server side controls in ASP.Net.
It's clear now
4. * The Application_Start method is called only once during the life cycle of an application. We can use this method to perform the startup tasks like loading data to cache, initializing static variables etc. However we should use this method only to initialize static values not instance data because it will be available only to the first instance of the HttpApplication class that is created.
* Application_BeginRequest and Application_EndRequest are to begin and end every requests (instances).
* Application_Error can be raised at any phase in the application life cycle.
* HttpApplication.Init called once for every instance of the HttpApplication class after all modules have been created.
* Dispose method os called before the application is destroyed. We can use this method to manually release any unmanaged resources.
* Application_End is called once per lifetime of the application before the application is unloaded.
It's clear now
5. Http handlers are the .NET components that implement the System.IHttpHandler interface. Any class that implements the IHttpHandler interface can act as a target for the incoming Http requests.
It's clear now
6. An Http module can register for the following events exposed by System.Web.HttpApplication object.
* AcquireRequestState event is raised when ASP.NET runtime is ready to acquire the Session state of the current HTTP request.
* AuthenticateRequest event is raised when ASP.NET runtime is ready to authenticate the identity of the user.
* AuthorizeRequest event is raised when ASP.NET runtime is ready to authorize the user for the resources that the user is trying to access.
* BeginRequest event is raised when ASP.NET runtime receives a new HTTP request.
It's clear now
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment