ASP. NET to build the Internet future space station (4)

Source: Internet
Author: User

I noticed that there is an ASP tag. Is it used to mark a control?
Yes. Its prefix is ASP's prefix. It indicates that this is an ASP control, and the latter part indicates that this is a server-side control, which is defined under the. NET Framework. I can also create our own controls and give them an independent prefix. In fact, we have defined some internal controls for our site. Well, now let's take a look at the running results of this program. The running results are similar to the above results. The difference is that the database access depends on the SQL provider. In addition, added a small attribute that defines the background color. Our program is basically the same as the above program design, but it is easy to add such attributes. We use this method every day to process tons of tables and add many other attributes. In fact, this is also the benefit of using server-side controls, which makes it easier for us to express methods and attributes in HTML, making programming easier and faster.


Therefore, we can see that the main difference between this code and the previous Code is that it does not require programmers to write a WHILE loop that traverses the entire records set. You do not need to display the result at a proper position in HTML. You can easily generate a table and tell it that your value comes from the records set.
Yes. I just jumped over one thing, that is what you said. Let's look back at the code. We call these data grids by name and bind them to the results from the data set and a specific table in the data set. Then we can use the data.
DgCustomers. DataBind ()

The preceding example shows a program that displays a simple table on the screen. This method looks simple and effective, but for a complicated table, can programs that require complex operations and display more fancy strings still traverse the entire records set in the same way?
Of course, this is actually a major feature of the. NET Server-side controls. We can easily customize the datagrid because it is a basic raw table. Datalist can also be customized so that each row or unit corresponds to a record. We can use a template to create a repeater Data Control to define each of its duplicates in a circular manner. Therefore, one head template and one end template define the start and end of the template respectively. We also have some item templates and some alternating item templates, which can provide us with more personalized designs. We also have a lot of good things on the website ASPNextGen.com, where we used data repeater for a lot of work and provided more custom output.

That's great. I can be like those exciting features. You just mentioned that you can develop your own controls and put them on the page, if the current table grid control cannot meet your needs, you can write your own code and apply the transformed control to any place you want.
Yes, but the most interesting thing is that you can not only customize your own controls, but also extend the functions of server components. For example, I can extend the data grid function, to meet my own special needs. To do this, we can use the server-side control that we fully compile, or a user control ). A user control is a kind of middleware. It is between a page control and a server control. You can use the user control to display methods and properties, or display more functions.

Developing these additional user controls is more complex than simply writing an ASP program, but more powerful functions are available, right?
You asked a good question. The complexity of developing user controls can surprise you. If you create an ASPC file and write some HTML in the file, you have a simple user control. If you want to INCLUDE the content of a page in each page, you can define the page as a HEADER and use it like using the INCLUDE file. You can easily include HTML results in your user control. Therefore, the simplest user control program is the HTML program. In addition, if I want to add some code to these pages in the same way, I can provide some functions in the user control and expose some attributes. For example, if I want to set the background color of my user control on each page, I can expose the background color attribute in my user control,
However, from another perspective, this will be a very complex task. For example, if you want to create a server control, a data grid Control won't be easy. Because it involves some things in the NET framework. There is a method to create this control, which must occur before the submission method and before the subcontrol is submitted to the page. Therefore, if you want to bind data or set the background color, you should do so within the appropriate time; otherwise, when the page is submitted, you will not get what you want. From these aspects, it would be complicated to do such a control. I once made a control, an ad rotator control. It is equivalent to a subcontrol Of the. NET Server Control. It can be bound to an XML file to display different advertisements on your site when the page is accessed. In his storage form, there is an image URL pointing to an image file, a navigation URL. When you click an advertisement, the URL will take you to the page related to the advertisement. This page is not fixed because it comes from different vendors. This page can be an image or text.
So far, he hasn't provided us with a method that shows how many times that BANNER has. Therefore, I added this property to this control, as if I had put a timer. Therefore, you can add a default value to the XML file to set the default value to 100 for one person or 200 for another person. Your default value will gradually decrease until zero. The image is no longer displayed. I think it will take some time to create such a control.
Whether you are an experienced ASP developer or an experienced ASP developer, you can easily create a basic user control. However, without today's technology, you may have to spend a lot of energy, maybe you have to go deep into the bottom layer to do a lot of work, and it all depends on your experience, and the richness of the functions provided by the system.
This is a bit like writing a hello world Program with a sink, which is a very complicated process. However, it is easy to write this program in C language. This does not mean that it is very easy to write all programs in C language. However, it seems that this method expands the development capabilities of developers. Therefore, if a developer wants to develop complex applications running on their WEB servers, they need to do a lot of work on ASP. NET.

What functions do you think ASP. NET will provide in the future? What kind of web service will be designed for ASP. NET?
Those are endless. However, credit card authentication is a huge functional requirement. Enter the card number, name, and address, and then let the web service return the Boolean value of YES or NO for each part. Next, either the authentication is successful or the transaction is exited because the authentication fails. Of course, you can also return results such as misspelled names, authenticated messages, or whether a zip code is valid.
There are so many things in this function. We also have some web service examples on our site. They are very basic applications and you can call them, they are all Tutorial programs we put on the website. They can give you enough information you want. With regard to ASP. NET and WEB services, I think there will be a huge market with them. You should know that a company named Amazon.com has done a lot of work to connect services. People can sell books on their own websites, but the book information is shown through Amazon.com, and those who sell books get credibility. This can be seen as a typical example of web service. This example shows how to display a list of books? You can use the web service to return the results of both the mysterious novels and the novels of stevenking.

Amazon.com is not actually the site you want to visit, but where can you get images, titles, and book lists. You can display them as you like.

Yes, the advantage of web service is that it is based on xml, so you can get information in this way and process it in your preferred way. As long as you can analyze and process xml Information, you can use web services. Therefore, you do not have to go to a. net web site to use web services.

-------------
======================================================= ==============


What is the most important thing for. NET programs? If you give some advice to our audience, they will accept ASP. NET more quickly.
Okay. You have used syntaxes for many times. You only need to learn the differences between them. If you encounter different processing methods, you do not have to follow the previous methods. Because you have been doing script work for a long time, there are many different things to learn. Secondly, the concepts of assembly and namespace should be clarified. Next, we will discuss the language issues. I used to be a VB programmer. Now I am a C # programmer. I like C #. It is a very good language. If there are 20 lines of vbprogram C #5 lines, the problem can be solved. But for COM, the. NET Framework has already handled those common jobs for you, so you only need to write some business logic code.

What you mean is to understand "What Is Assembly? "
Yes, Assembly, namespaces, background, and the entire. NET architecture must be understood.
The key to understanding namespaces and Assembly is to understand their concepts. The more you understand them, the deeper you understand the architecture. Understand what they are and why you need them. I think some ASP developers, or others without any development background, enter the ASP field because ASP is very easy to understand and can be easily accepted and you can do it in your own way. If you want to transform to the. NET Framework, you still need some effort. It is easier to understand if you have a development background, because you are familiar with related concepts, data formats, and the process calls these things, for new users, more work is required. Those who often develop scripts need to do more.

The ASP programming model uses a scripting language on the entire web page. Both client scripts and server scripts make the program look messy. Some of the code you often want to change or you have to modify it everywhere. Now, ASP. NET seems to have provided you with a more standard development method.

Now you can completely separate your code. You can have HTML code and program code to process data and get engaging results.

You mentioned that you are a C # programmer and ASP. NET supports C # on pages #. We can see the example of SQL Server. You are using VB, not VB script. Can you use c # On the page.
Correct. Or any other. NET Supported languages such as EIFFEL, VB, and COBOL. You can use these languages to do what you want

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.