[Getting started with ASP. NET] Method of attracting stars-page oo ideas

Source: Internet
Author: User

[Getting started with ASP. NET] Method of attracting stars
-- Page oo ideas

The internal force measures the martial arts of a person, and the neighborhood of the Xiaoyao school is really a baby. The person who learns this skill is like a black hole. In an instant, the cultivation accumulation of others for a lifetime is swept to the existing one, the name of the United States is "North Ming water, rather than self-production", "baichuan huihai, haina baichuan ".

However, I don't know how to learn this technique, so I couldn't help crying when I was completely empty and calm. In fact, this is definitely understandable. For a martial artist, the internal strength is symbolic of accumulation. Although it is a bit dumb, the accumulation over the past 20 years has never been enough, it does not mean the destruction of the spiritual world.

■ Computing impact-process-oriented programming ideas

The ancestor of ASP programmers is Feng nuoman. asp programmers have been living according to his teachings.

ASP programmers always think that everything in this world is like a person's life. There is a starting point called start and an end point called end. What he wants to deal with is like a person's life. From start to end, there is no turning back.

ASP programmers also think that everything in this world is like a person's life, divided into different stages, called modules. Every module has to complete a different task. When a teenager is studying, the young man has children, and the middle-aged man has a life, the old man is confused.

ASP programmers also think that everything in this world is like a person's life, there are only three ways to go: Sometimes stride forward, called order; sometimes face choice, called Branch; sometimes go around, it's called a loop.

ASP programmers always put the motto of "not accumulating steps, not even thousands of miles", so he accumulated all the similar things and memorized them as functions. In the future, he will encounter things of the same type, call the function.

ASP programmers call this kind of concept "process programming ideas". What they usually care about most is the process model, is there any similar processing process in these processes that can be summarized into functions.

Even in the face of such a small thing as website login, ASP programmers still follow their own beliefs, first model the process, 4-1, and then call all the previously accumulated functions, carefully knitting every step of this process: Do you not need to submit login data? He uses the response. Write brush to describe the user's page in order. Isn't the format required to be verified? He calls JavaScript Functions to check the value of each <input> one by one. Isn't it necessary to review the data? After reading the user data, he opened the thick accounts and checked them one by one. Isn't it necessary to make a result? He either takes the user to jump to the specified page, or calls a function to tell the user not to confuse.

So the ASP programmer is very happy, and he feels that the world is under his control. Although a guy named Smalltalk told him a long time ago that he was a cool-working hacker, ASP programmers were just puzzled at the time. Another C ++ said that he was clumsy and he was just confused; there was also a Java program that made a fortune in front of him, and ASP programmers began to worry. One day, the programmer dotnetcame back from learning and talked with him for a long time. Finally, the ASP programmer was shaken. In the dark, remember a great man telling him to keep pace with the times. However, despite the changing world, ASP programmers still cannot put down the internal force they have accumulated over the years. They say nothing in a short time, and they will not let go of the destruction of the spiritual world. So there are two kinds of voices in the heart that are constantly intertwined. Are they dead in silence or Phoenix Nirvana?

■ Genesis • 6th-object-oriented programming ideology
Dotnetprogrammers believe in OOP, and God is the framework.

On the first day, God said,All objects are objects. Objects have identities, statuses, and behaviors.;

So the dotnetprogrammer lists all the objects of the login function in the brain: Login object and login. ASPX page object, logon form frmlogin object, prompt message lblmessage object, User Name text field txtusername object, Password text field object txtpassword object, and logon button btnlogin object.

The second day, God said,Objects with the same features and behaviors are abstracted as classes. objects are an instance of classes.;

So the dotnetprogrammer abstracts the User Name text domain object and Password text domain object into textbox classes, and the others are abstracted into login, login. aspx, htmlform, label, and button classes, and the classes are instance-specific.

The third day, said God,The same features of objects are abstracted as attributes, and the same behavior processing is abstracted as methods.;

Therefore, dotnetprogrammers define the instance frmlogin, lblmessage, txtusername, txtpassword, and btnlogin as the attributes of the login class, and define the method btnlogin_click.

Private void btnlogin_click (Object sender, system. eventargs e ){
If (txtusername. Text = "Sun Erniang") & (txtpassword. Text = "cross slope "))
Lblmessage. Text = "warmly welcome to Miss Sun Erniang, the world famous martial arts star, to visit their hometown for investment ";
Else
Lblmessage. Text = "No, there's nothing false in this year! ";
}

God said on the fourth day,Class to be encapsulated;

Therefore, dotnetprogrammers add public, private, and protected before class identifiers, attributes, and methods.

God said on the fifth day,Classes can be inherited and merged;

Therefore, dotnetprogrammers Define Login. aspx as the login derived class, and add the following declaration statement at the beginning of login. aspx:
<% @ Page inherits = "webapplication1.login" %>

God said on the sixth day,Class Polymorphism.

So the dotnetprogrammer said to himself that I don't need it for the moment, and then lie down.

Soon he fell asleep, and only heard his dream coming slowly: On the 6th, I dragged several controls, defined several IDs, and added an event processing code, thanks to the omnipotent main framework and its loyal servant Visual Studio, it's a great choice!

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.