Page 144 - DCAP312_WEB_TECHNOLOGIES_II
P. 144
Web Technologies-II
Notes
Add a Logging Database Connection String to the Web.config File.
Self Assessment Questions
Multiple Choice Questions
True or False
1. .NET is not provides a visual interface for developers to create their applications, which
makes.
(a) True (b) False
2. JavaScript code using HTTP requests.
(a) True (b) False
3. Http Xml Request as it would not break the same domain origin policy.
(a) True (b) False
4. .......................as contained in the attribute mode.
(a) Liberalization (b) Privatization
(c) Web application (d) None of these
5. The Uniform Resource Locator was created in.............
(a) 1989 (b) 1999
(c) 1972 (d) 1994
7.3 Characteristics of ASP.Net
ASPX file format ASPX is a text file arrangement used to produce Web form pages; in
programming terminology, the ASPX file typically contain static HTML or XHTML mark-up, as
well as chalk up defining Web Controls and Web User Controls where the developers place all
the required static and dynamic content for the web page. Additionally, dynamic code which runs
on the server can be placed in a page within a block which is similar to other web development
technologies such as PHP, JSP, and ASP, but this practice is generally frowned upon by Microsoft
except for the purposes of data binding since it requires more calls when rendering the page.
The method recommended by Microsoft for dealing with dynamic program code is to use the
code-behind model, which places this code in a separate file or in a specially designated script
tag. Code-behind files are typically named something to the effect of MyPage.aspx.cs or MyPage.
aspx.vb based on the ASPX file name (this practice is automatic in Microsoft Visual Studio and
other IDEs). When using this style of programming, the developer writes code to respond to
different events, like the page being loaded, or a control being clicked, rather than a procedural
walk through the document. Rendering technique ASP.NET uses a visited composites rendering
technique. During compilation the template (.aspx) file is compiled into initialization code which
will build a control tree (the composite) representing the original (static) template. Literal text
goes into instances of the Literal control class, server controls are represented by instances of
a specific control class. The initialization code is combined with user-written code (usually by
the assembly of multiple partial classes) and results in a class specific for the page. The page
doubles as the root of the control tree. Actual requests for the page are processed through a
number of steps. First, during the initialization steps, an instance of the page class is created and
the initialization code is executed. This produces the initial control tree which is now typically
manipulated by the methods of the page in the following steps. As each node in the tree is a
control represented as an instance of a class, the code may change the tree structure as well
as manipulate the properties/methods of the individual nodes. Finally, during the rendering
step a visitor is used to visit every node in the tree, asking each node to render itself using the
138 LOVELY PROFESSIONAL UNIVERSITY