| |

VerySource

 Forgot password?
 Register
Search
View: 807|Reply: 4

Control category

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-6 21:00:01
| Show all posts |Read mode
What are the types of controls in ASP.NET?
Seen in some books ASP.NET control sub-client, server-side.
Also see HTML server, WEB server.
Excuse me, what types of controls are there in ASP.NET? What's the difference?
Where can I find detailed information in this regard?
Reply

Use magic Report

0

Threads

8

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-6 23:24:02
| Show all posts
Both divisions are correct, but the names are different
To put it simply, client-side controls and server-side controls are available in any basic book, so there is no need to go too far.
Reply

Use magic Report

0

Threads

12

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-3-9 12:00:01
| Show all posts
Server-side controls are relatively rich, and client-side types are relatively small. Client-side controls can also be used as server controls.
Reply

Use magic Report

0

Threads

64

Posts

35.00

Credits

Newbie

Rank: 1

Credits
35.00

 China

Post time: 2020-3-10 18:30:01
| Show all posts
If you write on the designer (aspx, ascx):

<asp: TextBox id = aaa Text = "demo1"> </ asp: TextBox>
adfa
<input type = text id = bbb Value "demo2" />
<asp: TextBox id = ccc runat = server Text = "demo3"> </ asp: TextBox>
<input type = text id = ddd runat = server Value "demo4" />
123456

Note that this is interpreted as 4 controls by asp.net!

Written in code like this:
  LiteralControl c1 = new LiteralControl (
    "<asp: TextBox id = aaa Text =" demo1 "> </ asp: TextBox>\r\n" +
    "adfa\r\n" +
    "<input type = text id = bbb Value" demo2 "/>\r\n");
  TextBox c2 = new TextBox ();
  c2.ID = "ccc";
  c2.Text = "Demo3";
  HtmlInputText c3 = new HtmlInputText ();
  c3.ID = "ddd";
  c3.Value = "Demo4";
  LiteralControl c4 = new LiteralControl ("123456");

From c1 and c4 you can see that there is no "client control". asp.net doesn't know dhtml or javascript (although vss will help you check the syntax and prompt some possible exceptions), it will always pack any non-server control code into a simplest server control, and then communicate with other servers The controls participate in the various processing cycles of the page together, and finally output html to the client.

c2 is a webControl. c3 is a htmlControl.

The basic objects of htmlControl are very similar to html. In this way, many codes in the html file can be directly transplanted, and "runat = server" can be easily converted into server controls. However, it can be seen from c1 and c3 that adding or not adding "runat = server" is completely different, rather than simply adding a parameter.

webControl has more rich functions, especially it maintains a lot of states and triggers events. For example, GridView can generate many interfaces by itself, and has complex processes such as data source processing, template processing, and paging. The entire webControl follows an interface habit that is unique to WinForm controls, such as the Text property, and is not the same as the HtmlControl habit of following the definition of a dhtml object.

Page and userControl are controls that can edit the interface on the designer and dynamically resolve at runtime. You can manually modify aspx or ascx and then execute it directly. At the same time they are automatically pre-compiled for maximum efficiency. Although "slower" than webControl, it is also very flexible. You can use the RAD development form to design the interface by dragging with the mouse. This is not a custom control and its exquisite interface development technology.
Reply

Use magic Report

0

Threads

64

Posts

35.00

Credits

Newbie

Rank: 1

Credits
35.00

 China

Post time: 2020-3-10 20:00:01
| Show all posts
Although vss will help you with syntax checking-> Although vs platform will help you with syntax checking and prompt some possible exceptions
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list