When the standard toolkit of ASP.Net server controls do not provide the required functionality, Web User controls can be built or used. Web User controls are built in the same way as Web Forms (.aspx), though it cannot contain the <HTML>, <BODY>, and <FORM> html elements, as these will be held in the Web Form where the control will be hosted.
Web User controls in ASP.NET end with the extension .ascx. They can be used in an ASP.NET page by registering them either on the page with the Register tag or in the web.config file. User Controls are very useful when reusing logic. Custom server controls are used in a situations where the code will be reused through a DLL.
Example
<%@ Register src="~/Controls/LatestPosts.ascx" TagName="LatestPosts" TagPrefix="pageElements" %>
<pageElements:LatestPosts ID="latest1" runat="server"></pageElements:LatestPosts>
Links
Revision number 6, Saturday, October 11, 2008 8:23:03 AM by PaulSpencer
You must Login to comment.
|
Wed, Apr 22, 2009 10:06 AM
by nlad
|
its realy very good,show me basic concept of web user control. Thanks!
|
Revision #12
Sat, Oct 13, 2012 10:32 AM
by
|
File Types
Here is a list of file extensions which are configured by default to be handled byASP.NET 2.0. asax used for application level logic (global.asax) ascx used for creating a web user control. ashx used to create a custom httphandler asmx used to create web services
|
Revision #2
Mon, Feb 4, 2008 8:00 AM
by
|
Authentication and Authorization
Authentication means figuring out who you are and Authorization means figuring out what you can do. Both are fundamental parts of the ASP.NET Security Model. An Overview of Authentication and Authorization - This is a good place to start. Samples and Quickstarts
|
Revision #8
Sat, Mar 10, 2012 6:26 AM
by
|
Composite Controls
Composite controls are controls thatcombine multiple controls together to forma new reusable control. For example, a simple composite control could consist of both aLabel control and a TextBox control. You can use UserControls (.ascx) files to create some
|