什么是用户控制? [英] what is user control?

查看:113
本文介绍了什么是用户控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是用户控件以及何时在c#中使用它?

what is user control and when this use in c#?

推荐答案

请查看以下链接:
http://www.c-sharpcorner.com /UploadFile/jayendra/how-to-create-usercontrol-in-windows-form-application/ [ http://forums.asp.net/t/1061924.aspx/1 [ ^ ]

下面给出了有关ASP.Net用户控件的说明:
ASP .NET中的用户控件 [
Look at the following link:
http://www.c-sharpcorner.com/UploadFile/jayendra/how-to-create-usercontrol-in-windows-form-application/[^]

Purpose of user controls:
http://forums.asp.net/t/1061924.aspx/1[^]

An explanation on ASP.Net user controls given below:
User controls in ASP .NET[^]


A 用户控件是一种复合控件,它的工作方式与ASP.NET网页非常相似-您可以将现有的Web服务器控件和标记添加到用户控件中,并定义属性和控制方法.然后,您可以将它们嵌入到ASP.NET网页中,在该网页中它们作为一个单元.

用户控件实质上更易于创建,因为您可以重用现有控件.它们使创建带有复杂用户界面元素的控件特别容易.

参考:
ASP.NET用户控件概述 [如何:将Web窗体页面转换为ASP.NET用户控件 [ ^ ]

如何:创建ASP.NET用户控件 [如何:在网页中包含ASP.NET用户控件 [
A user control is a kind of composite control that works much like an ASP.NET Web page —you can add existing Web server controls and markup to a user control, and define properties and methods for the control. You can then embed them in ASP.NET Web pages, where they act as a unit.

User controls are substantially easier to create, because you can reuse existing controls. They make it particularly easy to create controls with complex user interface elements.

Refer:
ASP.NET User Controls Overview[^]

If you have developed an ASP.NET Web page and would like to access its functionality throughout your application, you can make some minor alterations to the page to change it to a user control.
Refer: How to: Convert Web Forms Pages into ASP.NET User Controls[^]

How to: Create ASP.NET User Controls[^]
How to: Include ASP.NET User Controls in Web Pages[^]


You can use User Control to:

1. Logically divide page
2. Need to Cache UC
3. Async loading section of page
4. Commonly used section of page in various parts of project


using Web server controls in your ASP.NET Web pages, you can create your own custom, reusable controls using the same techniques you use for creating ASP.NET Web pages. These controls are called user controls.

A user control is a kind of composite control that works much like an ASP.NET Web page—you can add existing Web server controls and markup to a user control, and define properties and methods for the control. You can then embed them in ASP.NET Web pages, where they act as a unit.


这篇关于什么是用户控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆