Umbraco website creation (7) calling external user controls

Source: Internet
Author: User
Tags umbraco

Needless to say about the user control ~!. Net friends all know ~!

Umbraco is originally developed by. net, so it is easy to reference a user control that you write yourself.

First, you can write your own user controls in vs2005. For example, my website needs an online message function.

We can use the tables in the database. If you do not like the tables, you can also press your own keys, which is very convenient.

CodeNo more explanation ~! It is the same as our usual development.

After the configuration is completed

Copy the file to our project --- For example: C: \ Inetpub \ wwwroot \ gbkj \ usercontrols

Directory. The \ usercontrols directory is required.

Then open the. ascx file in notepad and add

<Form ID = "form1" runat = "server"> </form> label

Because in.. net, the user control must be in. this set of tags is available on the ASPX page, but we do not have them here. ASPX page, so we add the above Code to the user control;

Save.

Go to the background and create a file in developer --> macros. You don't need to press the XSLT file here,

 

Here, the user control can be found and saved.

 

Then, call the file where we need to use the control.

For example, <? Umbraco_macro macroalias = "leavetext"> </? Umbraco_macro>

Save ~! You can browse again ~! Effect.

 

Isn't it easy? Well, you can add some specific features as needed ~!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.