Page 272 - DCAP312_WEB_TECHNOLOGIES_II
P. 272
Web Technologies-II
Notes We can enable debugging in ASP.NET page by writing the <%@Page debug= “True” %> page
directive at the top of the page. This statement asks the compiler to exclude debugging symbols
into the compiled page, and allows the debugger to attach to the running program. But before
using the debugger, we should also need to view the web page in the browser so that the
debugging symbols are loaded for the page.
The SDK debugger that comes along with .NET SDK can be found in the Guidebook directory.
This debugger has all the features such as viewing contents of variables, setting breakpoints
on specific exceptions, expressions, or specific lines, stepping into, out of, and over code, and
viewing the call stack, threads and modules as that of Visual Studio debugger except that SDK
debugger does not support remote debugging or Edit and Continue features. Therefore it can
be presumed that SDK debugger is a read-only debugger that does not allow us to edit code
inline. We can just edit the code externally and to view the new changes made in the application
we have to rerun the application.
Just-In-Time debugging is another technique to debug a program that is started outside of
Visual Studio. If we have enabled Just-In-Time debugging, we can view a dialog box when a
crash occurs. Debugging a traditional ASP application generally involves placing Response.
Write statements throughout our code to track variable values and execution paths. If we fail
to remove debugging statements before we deploy our application, the statements are visible
to users. ASP.NET makes Web application debugging much simpler to use. We can use tracing
statements to debug our application in a way that is similar to using Response. Write statements.
However, we can leave the tracing statements in our application, even after deployment.
We can configure the Web application to allow tracing at either the page level or the application
level, and we can easily turn it on and off. We can also control the destination of the tracing
Output to allow only certain users to see the debugging Output.
ASP.NET incorporates a variety of features and tools that allow us to design and implement
high-performance Web applications. These features include:
• An improved process model.
• Compilation of requested pages and automatic storage on the server.
• ASP.NET-specific performance counters.
• Web application testing tools.
ASP.NET also gives us the ability to create Web applications that can handle the demands of
processing large numbers of requests simultaneously.
14.1 Debugging in an ASP.NET Application
ASP.NET is a web application framework developed by Microsoft to allow programmers to
build dynamic web sites and web applications. ASP.NET supports compiling applications in a
special debug mode that facilitates developer troubleshooting. Debug mode causes ASP.NET
to compile applications with extra information that enables a debugger to closely monitor and
control the execution of an application. Applications that are compiled in debug mode execute
as expected. However, the performance of the application is affected. To avoid the effect on
performance, it is a good idea to enable debugging only when a developer is doing interactive
troubleshooting. By default, debugging is disabled, and although debugging is frequently enabled
to troubleshoot a problem, it is also frequently not disabled again after the problem is resolved.
14.1.1 Creating an ASP.NET Application
Before we begin it should be noted that SharpDevelop does not have great ASP.NET support.
There is no web forms designer, no intellisense for ASP.NET pages (.aspx) and no support for
266 LOVELY PROFESSIONAL UNIVERSITY