How to Debug the Web Application Within the Visual Studio

Description

Learn how to debug the Web Application within the Visual Studio.

Transcript
Just one last thing, when you are writing the code behind, it is often difficult to try to diagnose errors. For example, if you run the web application and it does not display the right data or something goes wrong. It is useful to debug the application within Visual Studio. Now, you can do that with normal applications such as Windows Applications and class libraries. You can also do it with asp.net web applications. What you will probably want to do is set a break point in one of your event handlers. So to set a break point, the easiest way to do that, if you choose the line where you want the break point go and in the margin, in the gray margin, just click that with your left mouse button and that sets the break point. And then, to run the application in debug mode, go to the debug menu and select start debugging. Earlier, we run the application as start without debugging but now we are going to run it with debugging enabled. So, let me click that menu right in there. Now, if this is the first time you have tried to debug this application, you will get this dialogue box. On the dialogue box, it warns you that debugging is not currently enabled in this web application. So at this point, you have two choices. You can add a web.config. This is a configuration file which will get added to your asp.net web application. It will have various information such as database connection. To run this security information whether tracing is enabled or disabled and also whether debugging is enabled or disabled. So, that is the first option. You can add a new web.config file with debugging enabled. The other option is to run without debugging. It means do not add web.config. Just run the application firstly. Well, obviously, we want to run it in debug mode so let us select the first item and click okay. So, Internet Explorer opens up and it runs My Web Page. In the textbox, I am going to enter another name, so Thomas Peter Olsen. He is our little boy. I will click the button. And, when I click the button, it will post the data to asp.net and asp.net will invoke my event handler within debug mode and the application will stop just at the debug point. So, let us click the button and see. There we go. So, the arrow here in the margin indicates this is the next statement about to be executed. It has not executed the statement yet. At this point, I can move my mouse over various controls. Say for example, if I hover over Result label, it will display various bits of information about the control. If I expand it, you can see I can zoom down quite deeply actually, as deeply as I need to, into the subject to see exactly what data it contains. This is a great tool without debugging complex applications that really enables you to hopefully, quite quickly find where the others are in your application. So, at this point, we can single step. I again click this button here to Step Over the statement or if you want to, you can step into the next statement. This could be quite useful if you call on the method and you want to step through the internal statements within that method. Okay, I will just click Step Over and Step Over again and as you can see, we fall out to the method now and that is the end of the method so it returns the appropriate message back to my web page. We are done here. That is our first lesson. We have seen how asp.net fits in to the grand scheme in web development over the last decade or so. And, we have worked together to create a simple web site in C#. We have added some simple code to the web site to handle service side events. In particular, we handled the click event on the button. Do not worry too much if you do not quite understand exactly how these events are working underneath the covers at the moment. We are going to drill down into the details in the next few lessons. We will also take a closer look at precisely how asp.net web pages get converted into html mark up but it will last for later. So, take a break. Come back soon for the next exciting installment.
Related Articles

How to Debug the Web Application Within the Visual Studio

Qualities of a Good Report Designer in Visual Studio

Whether you are using the newest version of Visual Studio, you will be able to find the most suitable report designer in Visual Studio. Learn how to get one that works for you in this article....

How to uninstall Visual Studio 2005 from your system thoroughly?

Want to uninstall Visual Studio 2005 but do not know what you should do? If this is you are encountering right now that you are in the right place here. This article describes how to uninstall Visual Studio 2005 program when the Add/Remove programs is not functional. If you are having problems in uninstalling Visual Studio 2005, you are in the right place here!...

How to uninstall Visual Studio 2008 from your system thoroughly?

Want to uninstall Visual Studio 2008 but do not know what you should do? If this is you are encountering right now that you are in the right place here. This article describes how to uninstall Visual Studio 2008 program when the Add/Remove programs is not functional. If you are having problems in uninstalling Visual Studio 2008, you are in the right place here!...

How to fix AlphaVSS.WinXP.Debug.x64.dll error quickly within clicks?

Do you want to fix AlphaVSS.WinXP.Debug.x64.dll error instantly but have no idea? In this article, you will get solutions on what AlphaVSS.WinXP.Debug.x64.dll error is and how to quickly fix this error within minutes!...

Purchase Microsoft Visual Studio 2010 cheap

Discount computer software Microsoft Visual Studio 2010 buy cheap! An integrated environment that simplifies creating, debugging and deploying applications. Unleash your creativity and bring your vision to life with powerful design surfaces and innovative collaboration methods for developers and designers....

Reporting for Visual Studio Using ASP.NET Web Forms

You can develop reports through Visual Studio. If you are adept in using the asp.net, you can learn more about reporting for Visual Studio in this article....

Dotnetnuke Web Application Framework

This tool is developed using Content Management Tool, DotNetNuke. All Skins, Models, Container are developed using Microsoft Visual Studio .Net 2005 as User Controls. In content pane, Models for Blog, Special Projects, Alphabetic Search, Series, are developed and installed. Series respective text as well as video is displayed in Text and Video Tabs using Flash Videos....

Can I Remove Microsoft Debug System?

Microsoft Debug System is a rogue antivirus application which was designed by cyber criminals, aiming to deceive computer users and steal their money. As soon as ms Debug System gets to your computer,......

Which is the Better Choice - Dreamweaver Or Visual Studio?

When talking about web site creation, the two programs that stand out are Adobe's Dreamweaver and Microsoft's Visual Studio and someone eventually will ask which one is the better program for what they need. The obvious issue that comes to mind before even opening the box is that Visual Studio is a Microsoft creation....

How to Get Rid Of the Windows Debug System Virus

Windows debug System virus, is a fake rouge anti- spyware which disguises or in other words camouflages itself as an anti – malware program. This virus is spread with the help of Trojan viruses. Windows debug system virus is downloaded to your system and installed without your permission. This Program tries to give the appearance as it is legitimate Microsoft anti-malware software. But don'...