Debug Javascript in Visual Studio

Source: Internet
Author: User
Summary
A good application Program All input items must pass verification before being submitted to the server for processing. Therefore, client verification is required. Almost all browsers support JavaScript to complete this task very well.

By Rajendra Kumar Sahu

ArticleContent
Introduction
Configuration
Conclusion

Introduction
In fact, web applications are more convenient to upgrade than desktop applications. For example, from the perspective of applications, the development of these two technologies is undoubtedly more popular than desktop applications. Web Application designers are different from Desktop Application designers. Web pages are composed of Static HTML tags, images, script tags, and JavaScript. Web pages are combined with Web servers to deliver requests to the server through a browser for processing. Today, there are many different Web servers. Popular ones include IIS, websphere, WebLogic, and Apache. Web servers are used to process scripts, and some basic class libraries are used to process these scripts. When a page sends a request from a browser to the server, HTML tags are not converted. the browser is responsible for interpreting and parsing these HTML tags.

Today, Web pages are becoming more and more interactive. They often collect user input and send the information to the server for processing. Therefore, verifying each input on the page is part of the developer's work. Web page verification is already necessary. If client-side authentication is not performed, some wrong requests may occur, which may cause the web application to throw an error message or even crash. In addition to input verification on the server, client verification is also required. Some popular scripts can be used for client verification. JavaScript and VBScript are two of them. There is no script specifically designed to cope with web-side verification, which puts developers into an embarrassing situation. In today's era, users prefer to do more things on the client, but only give them to the server when necessary.

This technology is completely processed on the client. It is not Ajax (asynchronous Java and XML ). I have used Ajax in some occasions. It is indeed very powerful and different from JavaScript, but it still needs a lot of Javascript in Ajax. Developers have to put a lot of LogicCodeAs JavaScript becomes more and more popular, more and more time is spent debugging and modifying JavaScript. Microsoft Visual Studio ide allows developers to easily write code, and debugging is much easier than traditional ASP applications. Let go of some new features of vs ide. Many people find it inconvenient to debug JavaScript. But now you can use some configurations to make debugging JavaScript easier. So how should we do it? Next, I will show you some tips for debugging objective cirpt in Asp.net.

In Asp.net, I debug JavaScript step by step. In this article, I used IIS and Visual Studio 2005.

Configuration
Step 1:
Open an existing Asp.net application in Visual Studio 2003/05, which requires some JavaScript.

Step 2:
When we create a web project in Microsoft Visual Studio, a file named Web. config is created in this web project by default.
Let's check its settings.<CompilationDebug= "False"Strict= "False"Explicit= "True" />

Set the debug attribute to true as follows:

< Compilation Debug = "True" Strict = "False" Explicit = "True"   />

Step 3:
Open Internet Information Service (IIS) Manager
Start> Administrative Tools> Internet Information Service (IIS) manager-> website-> default website-> right-click the web project you want to debug-> properties-> virtual directory tab-> Configuration-> select debug in the new windows window tab-> select the check boxes "enable ASP server script debugging" and "enable ASP Client script debugging. (See 1)
Figure 1

Step 4:
Open IE, click "Tools"-> Internet Options-> Advanced tab-> cancel "Disable script debugging (Internet Explorer)" and "Disable script debugging (Others)" in the menu bar). (See 2)
Figure 2

Step 5:
Now, open your web project in Visual Studio IDE.
Note: javascript must be placed in a separate. js file, instead of writing JavaScript directly on the. ASPX page. Then add a breakpoint to a line in the. js file just like the. CS or. VB file.

Step 6:
When you run your web project, the program stops running at the breakpoint you set.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.