Converting Web Pages to User Controls in .NET

There are instances where you would like to use web page functionality repeatedly within your application and you might want to convert it to a user control so that you can do so. It is easy to convert a web page to a user control with some minor modifications in it.

As you know the user control files have an extension .ascx, you have to change the file extension of the web page to that of .ascx. For this you can use the Rename functionality found in the context menu from the Solution Explorer.

After renaming the file, you have to remove the html, body, and the form tags found in the web page. Now coming to the top of the page, you will have the @page directive. Now change the @page directive to a @control directive.

The attribute like language, AutoEventWireup, CodeFile and Inherits can be left as it is. Add an attribute called className to the @control directive and give a ClassName. Now you are ready to use this user control in the web page of your choice.


Networkfleet Unveils Innovative New User Interface for Fleet Tracking and Management
SAN DIEGO----Networkfleet, Inc. today announced the launch of a new streamlined user interface that provides fast and easy access to detailed vehicle performance and fleet tracking information, larger maps, better access to reports, and easy, intuitive navigation.

20 Brand New Factory Unlocked Apple iPhone 4G 32GB Sim Free
Category: Items & Merchandise User : paul_mobiles Date : Wednesday, 01/09/10 - 08:10AM Description : Apple iPhone Specifications & Features Screen 3.5 Inch Multi Touch Colour Screen (320 x 480 Pixels Imaging 2 Megapixel Digital Camera Camera Settings Video Record Video Player Movie & TV Show Player Video Controls (Play, Pause, Chapter FF, Chapter Rewind & Volume) Video Record Viewfinder Display ...

Epic Games Announces ‘Epic Citadel' App Now Available on App Store
CARY, N.C.--(BUSINESS WIRE)--Epic Games, Inc. today announced its "Epic Citadel" App is now available from the App Store. The app showcases the technical capabilities of Epic's award-winning Unreal Engine 3 on iPad, iPhone and iPod touch. In "Epic Citadel," players navigate a fictional castle realm using simple controls and the innovative Multi-Touch user interface. "Epic Citadel" also features ...




______________________________________________________

Recommended Resource



| Converting Web Pages to User Controls in .NET | .Working on .NET User Controls | Overview of ASP.NET User Controls | Web User Controls - Creation and Implementation | Advantages of using User Controls in ASP.NET | Re-usability of User Controls in ASP.NET | Personalizing Web Application by Creating User Controls in .NET | Customizing your Application with VB.net User Controls | Building User Controls in ASP.NET | Examples of User Controls in VB.NET | Example of C# User Controls | Where to use Visual Basic User Controls | Working on User Interface Controls | Creating Dynamic User Controls | Understanding VB .NET User Controls | Creating User Controls VB.NET | How to load user controls dynamically |



_______________

FREE Subscription

Stay Current With the Latest Technology Developments Realted to .NET. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.


 

| Privacy Policy for www.dotnet-guide.com | Disclosure | Contact |