page lifecycle

Upload: faisalhussain2008

Post on 11-Oct-2015

16 views

Category:

Documents


0 download

DESCRIPTION

Page Lifecycle events

TRANSCRIPT

Asp,Asp.Net and Page Life Cycle1)What is Web Page?Asnwer: A web page or webpage is a document commonly written in HyperText Markup Language (HTML) that is accessible through the Internet or other network using a browser. A web page is accessed by entering a URL addresses and may contain text, graphics, and hyperlinks to other web pages and files. The page you're reading now is an example of a web page.=======================================================================================2)When was the first web page created?Answer: The first web page was created at CERN by Tim Berners-Lee and put online August 6, 1991.========================================================================================3)What is the difference between a website and web page? A website refers to a central location that contains more than one web page. For example, Computer Hope is considered a website, which contains thousands of different pages. However, this page you're reading now is considered a web page on Computer Hope.=========================================================================================4)what are the different types of Frameworks to develop web application?Answer: 1)php 2)Jsp 3).Net 4)SalesForce e.t.c......=========================================================================================5)what are the different type of technology used in .net to develop web application?Answer: 1)Asp 2)Asp.Net 3)MVC=========================================================================================6) What is ASP/ Classis ASP?Answer: ASP stands for Active Server Pages. ASP is a scripting language, which is interpreted instead of compilation, in which we can use sub routines. The ASP file normally contains HTML tags, along with scripts, which is interpreted on the server (The code surrounded by the ASP delimiters ). The ASP Code can have expressions, statements, procedures, or operators valid for the scripting language you prefer to use (like VB script, Jscript etc.==========================================================================================7) What are the advantages of using ASP?Answer: HTML is used only to create static web pages (which displays information) With the use of ASP one can create dynamic web pages,where client can communicate with the web server and vice versa. Thus using ASP interactive webpages can be created.==========================================================================================8)What is ASP.NET?Answer: 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=========================================================================================9)what is Maindifferences between classic asp and asp.net?Answer: The basic difference between ASP and ASP.NET is that ASP is interpreted; whereas, ASP.NET is compiled. This implies that since ASP uses Vb-script; therefore, when an ASP page is executed, it is interpreted. On the other hand, ASP.NET uses .NETlanguages, such as C# and VB.NET, which are compiled to Microsoft Intermediate Language(MSIL).=========================================================================================10)What are different of Model to Write the code in Asp.Net?Answer: 1)CodeBehind Model 2)InLine Model=========================================================================================11)What is Difference Between CodeBehind and InLine model?Answer:Code Behind Code Behind refers to the code for an ASP.NET Web page that is written in a separate class file that can have the extension of .aspx.cs or .aspx.vb depending on the language used. Here the code is compiled into a separate class from which the .aspx file derives. You can write the code in a separate .cs or .vb code file for each .aspx page. One major point of Code Behind is that the code for all the Web pages is compiled into a DLL file that allows the web pages to be hosted free from any Inline Server Code.Inline Code Inline Code refers to the code that is written inside an ASP.NET Web Page that has an extension of .aspx. It allows the code to be written along with the HTML source code using a tag. It's major point is that since it's physically in the .aspx file it's deployed with the Web Form page whenever the Web Page is deployed.=========================================================================================12)What are the different stages in Page Life Cycle ? Answer: Following are the different stages in Page Life Cycle 1)Start 2)Initialization 3)Load 4)Validation and Post back 5)Rendering 6)UnLoad=========================================================================================13)What is http header?Answer: HTTP headers expose a great deal of information about your client as well as the server you are working, the application you are designing, as well as the environment you are in (SSL, etc.).The functionality for this is held in "Request.ServerVariables", so you only need to access that.=========================================================================================14)How to handle Error in ASP?Answer: Using On Error Resume Next========================================================================================15)What type of code, client-side or server-side, is found in a code-behind file of a Web page?Answer: A code-behind file contains the server-side code, which means that the code contained in a code-behind file is executed at the server.========================================================================================16)What events are fired when a page loads?Answer: The following events fire when a page loads: Init()- Fires when the page is initializing. LoadViewState()- Fires when the view state is loading. LoadPostData()- Fires when the postback data is processing. Load()- Fires when the page is loading. PreRender()- Fires at the brief moment before the page is displayed to the user as HTML.========================================================================================17)What is AppDomain ? Answer: In .NET facility is provided to create logical partitions inside the process and these partitions is called as AppDomain. A single process can have one or more AppDomain.========================================================================================18)What is an ASP.NET Web Form?Answer:ASP.NET Web forms are designed to use controls and features that are almost as powerful as the ones used with Windows forms, and so they are called as Web forms. The Web form uses a server-side object model that allows you to create functional controls, which are executed on the server and are rendered as HTML on the client. The attribute, runat="server", associated with a server control indicates that the Web form must be processed on the server.========================================================================================19)Which ASP.NET configuration options are supported in the ASP.NET implementation on the shared Web hosting platform?Answer: There are many ASP.NET configuration choices, which are not able to configure at the site application, or child directory level on the shared hosting environment. Some options can produce security, performance, and stability problem to the server and therefore cannot be changed.========================================================================================20)What is httpModule?Ans: An http mdule is an assembly that is called on every request that is made to your application http modules ar also called as part of the Asp.net request pipleline and have access to lifecycle events throught the request.========================================================================================21)What is httphandler?Answer: Http handler is the process that runs in response to a request made to an asp.net application .The most common http handler is an asp.net page handler that process the .aspx files========================================================================================22)What is a round trip?Answer: The trip of a Web page from the client to the server and then back to the client is known as a round trip.========================================================================================23)Define Virtual folder?Answer: It is the folder that contains web applications. The folder that has been published as virtual folder by IIS can only contain web applications.========================================================================================24)What are the Web Form Events available in ASP.NET?Answer: Page_InitPage_LoadPage_PreRenderPage_UnloadPage_DisposedPage_ErrorPage_AbortTransactionPage_CommitTransactionPage_DataBinding========================================================================================25)Which event determines that all the controls are completely loaded into memory?Answer: The Page_Load event determines that all the controls on the page are fully loaded. You can also access the controls in the Page_Init event; however, the ViewState property does not load completely during this event.========================================================================================26)Wha is URI and URL?AnsWer: URI- Uniform Resource Identifier: its a string and its responsibility is to identify a resource by meta-information. It gives information about only one resource. URL- Uniform Resource Locator: identifies the resource on the net and tells it is obtainable using what protocols.========================================================================================27)Is AppDomain created with every request ?Answer: No AppDomain is not created with every request .It is created only for the first request and later on it is reused.========================================================================================28)What are Events of HttpModule?Answer: BeginRequest AuthenticateRequest AuthorizeRequest ResolveRequestCache AcquireRequestState PreRequestHandlerExecute PostRequestHandlerExecute ReleaserequestState UpdateRequestCache EndRequest========================================================================================29)What is PreInit?Answer: PreInit is the first event in page life cycle. It checks the IsPostBack property and determines whether the page is a postback. It sets the themes and master pages, creates dynamic controls and gets and sets profile property values. This event can be handled by overloading the OnPreInit method or creating a Page_PreInit handler.========================================================================================30)What is Init?Answer: Init event initializes the control property and the control tree is built. This event can be handled by overloading the OnInit method or creating a Page_Init handler.========================================================================================31)What is InitComplete?Answer: InitComplete event allows tracking of view state. All the controls turn on view-state tracking.========================================================================================32)What is LoadViewState? Answer: LoadViewState event allows loading view state information into the controls.========================================================================================33)What is LoadPostData?Answer: During this phase, the contents of all the input fields defined with the tag are processed.========================================================================================34)What is PreLoad?Answer: PreLoad occurs before the post back data is loaded in the controls. This event can be handled by overloading the OnPreLoad method or creating a Page_PreLoad handler.========================================================================================35)What is Load?Answer: The Load event is raised for the page first and then recursively for all child controls. The controls in the control tree are created.This event can be handled by overloading the OnLoad method or creating a Page_Load handler.========================================================================================36)What is LoadComplete ?Answer: The loading process is completed, control event handlers are run and page validation takes place. This event can be handled by overloading the OnLoadComplete method or creating a Page_LoadComplete handler.========================================================================================37)What is PreRender ?Answer: The PreRender event occurs just before the output is rendered. By handling this event, pages and controls can perform any updates before the output is rendered.========================================================================================38)What is PreRenderComplete?Answer: As the PreRender event is recursively fired for all child controls, this event ensures the completion of the pre-rendering phase.========================================================================================39)What is SaveStateComplete?Answer: State of control on the page is saved. Personalization, control state and view state information is saved. The HTML markup is generated. This stage can be handled by overriding the Render method or creating a Page_Render handler.========================================================================================40)What is UnLoad?Answer: The UnLoad phase is the last phase of the page life cycle. It raises the UnLoad event for all controls recursively and lastly for the page itself. Final cleanup is done and all resources and references, such as database connections, are freed. This event can be handled by modifying the OnUnLoad method or creating a Page_UnLoad handler.========================================================================================41)What are the objects created when a request arrives?Answer: HttpContext HttpRequest HttpResponse HttpContext HttpRuntime HttpApplication========================================================================================42)What is ApllicationManager?Answer: Manages ASP.NET application domains for an ASP.NET hosting application.========================================================================================43)What is Hosting Environment?Answer: Provides application-management functions and application services to a managed application within its application domain. This class cannot be inherited.========================================================================================44)What is HttpRuntime?Answer: Provides a set of ASP.NET run-time services for the current application.========================================================================================45)Whay is HttpContext?Answer: Encapsulates all HTTP-specific information about an individual HTTP request.========================================================================================46)Whay is HttpRequest?Answer: Enables ASP.NET to read the HTTP values sent by a client during a Web request.========================================================================================47)Whay is HttpResponse?Answer: Encapsulates HTTP-response information from an ASP.NET operation.========================================================================================48)Whay is HttpApplication?Answer: Defines the methods, properties, and events that are common to all application objects in an ASP.NET application. This class is the base class for applications that are defined by the user in the Global.asax file.========================================================================================