当你需要.ascx文件,你会如何使用它们? [英] when do you need .ascx files and how would you use them?

查看:186
本文介绍了当你需要.ascx文件,你会如何使用它们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在建立一个网站时,会是使用.ascx文件是个好主意?到底是什么的.ascx,它用于什么?例子将有很大的帮助的感谢!

When building a website, when would it be a good idea to use .ascx files? What exactly is the .ascx and what is it used for? Examples would help a lot thanks!

推荐答案

它的延伸 用户控制 你必须在你的项目。

Its extension for User Control you have in your project.

一个用户控件是一种复合控件的那个很像一个ASP.NET Web页面,您可以添加现有的Web服务器控件和标记用户控件,并定义控件的属性和方法。然后,您可以将它们嵌入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.

简单地说,如果你想有一个将在许多网页在你的项目中使用,那么你应该创建一个用户控件或综合控制,并在页面中使用它的一些的功能即可。它只是帮助你在保持相同的功能和code在一个地方。并使其可重用的

Simply, If you want to have some functionality that will be used on many pages in your project then you should create an User control or Composite control and use it in your pages. It just help you in keeping same functionality and code at one place. And make it reusable .

这篇关于当你需要.ascx文件,你会如何使用它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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