In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to use VB.NET Web Forms, I hope you will get something after reading this article. Let's discuss it together.
Although there are some components related to Internet functions in Visual Basic 6, such as WebClasses, Winsock, and WebBrowser controls, there are no more exciting features. WebClasses, in particular, is more like being added later, and it can be said to be of no use at all.
But in VB.NET, network function plays an important role. First, there is Web Services in VB.NET, which will be the replacement of DCOM. Secondly, VB.NET Web Forms. Web Forms enables users to effectively build fully interactive Internet sites without using the old ASP or CGI. Only in theory, I don't want you to really do that. )
Before introducing the details of VB.NET Web Forms, let's take a moment to introduce some theoretical basics.
So what are the shortcomings of the Internet development tools we use today? ASP is generally required for any important development activity, but I must make it clear that I don't like it. First of all, it makes the code we write look messy. We must mix the presentation layer (the actual HTML code) with the ASP code. We should hide all the code behind the form, and although there are several ways to solve this problem, it is not ideal. Second, time must be wasted to support all users of older computers, and if their browsers do not support javascript, we need to find this problem and modify the web page to meet the needs of users. In addition, there are problems with state management. If someone logs on to the site and we want to know the basics about it, we need to use the Session object. When there are multiple machines that need to access Session objects, the website will be heavily loaded, and then we will run into trouble.
Incredibly, VB.NET Web Forms will be able to solve all these problems. Web Forms is a brand new ASP.NET (no longer ASP+), and they can use us to effectively create interactive Internet web pages in VB.NET, and the job is very easy. We can simply create a Web Form in VB.NET. This process is somewhat similar to designing a WebClass, but unfortunately, we can only design a web page in FrontPage and pass the generated HTML code to Web Form in VB.NET.
Tip: although you can transfer the HTML code generated in FrontPage to Web Form in VB.NET, this is somewhat different from the reality. In my many experiments, it seems that there is no problem when the web page is relatively simple, but if the output of the web page becomes complex, it will go wrong. This issue should be fixed in future versions.
Therefore, we can create basic web pages through Web Form, and then add interactive elements such as text boxes or submit buttons to VB.NET, as well as the more advanced HTML function ━━ Web Controls that does not need to be downloaded independently. The web page designed in this way is compatible with all browsers.
Tip: there are many Web Controls bundled in VB.NET, for example, the Calendar control that we will use later.
After designing the web page and adding interoperability elements, you need to add some more code to make the two better integrate. That is, we have a text box and button on Web Form, but we still need to write a piece of code to get the data entered in the text box and display it in the label, either add it to the database, or check it in a user list, and then direct the user to the member area on a regular basis.
The key problem here is that we can treat the entire web page and object as one object. You no longer need to request some form fields as you did in the original ASP, but just call the object as you did in Windows Form. After comparing ASP.NET with ASP, let's look at the problems I raised above and figure out how to solve them. First of all, it is the problem of mixing HTML and ASP code. This problem will not be encountered in VB.NET, the HTML web page is completely separated from the code used, only one line of code on the Web Form is related to the code module used, and the other work is done by the Internet server. Tip: just as ASP files have .ASP suffixes, Web Forms has .ASPX suffixes. When the Internet server submits this page to the user,. NET Framework first automatically processes it, for example, Web Controls is converted to HTML code, compiled code, and so on, which we will talk about in more detail later.
With the original ASP, we had to spend some time checking the user's browser and making appropriate changes to the content to make it more compatible. In VB.NET, it can do all the processing for us,. NET Framework can only generate HTML code that can be recognized by the target browser.
What about state management? This is a difficult problem for most ASP developers. In ASP.NET, status is stored in a web page sent to the user (in a way that hides fields. ). The next time you send the page, you can read and use the data in it.
◆ We can think of state management in ASP.NET as similar to using Property Bags, which automatically adds information, such as text box information, to Property Bags. In addition, we can add the relevant information ourselves and then use it.
◆ tests show that compared with traditional Session objects in ASP, this method of state management has a great improvement in performance.
◆ security is still a problem, and the degree of standardization of data coding is very high. If really effective security is needed in the actual operation, it is also necessary to combine state management with existing database password records and similar things according to the specific situation.
Well, this is ASP.NET, a brand new tool that provides the functionality that ASP developers dream of. If you use Visual Basic as a development tool and want to get involved in Internet application development, this will be an ideal opportunity.
After reading this article, I believe you have a certain understanding of "how to use VB.NET Web Forms". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.