Kooboo Cms-html.fronthtml.position Detailed

Source: Internet
Author: User

DataContract

Data contract

Http://www.cnblogs.com/Gavinzhao/archive/2010/06/01/1748736.html

Https://msdn.microsoft.com/zh-cn/library/system.runtime.serialization.datacontractattribute.aspx

Html.FrontHtml.Position ("main") detailed

1. First we open the project file, in the search box, write the fronthtml find the Fronthtmlhelper class, such as:

The following is a related method for position.

        #regionPosition Public VirtualIhtmlstring Position (stringPositionID) {            returnPosition (PositionID,""); }         Public VirtualIhtmlstring Position (stringPositionID,stringdefaultcontent) {            returnPosition (PositionID, () =defaultcontent); }         Public VirtualIhtmlstring Position (stringPositionID, func<string>Defaultcontentfunc) {            if(PageContext.PageRequestContext.RequestChannel = =frontrequestchannel.design) {return NewPagedesignholder ( This, PositionID); }            Else            {                varpositions =getcontentsforposition (PositionID); if(Positions. Length = =0) {Defaultcontentfunc= Defaultcontentfunc = =NULL? () ="": Defaultcontentfunc; return Newhtmlstring (Defaultcontentfunc ()); }                Else                {                    varHtmlstrings =renderpositioncontents (positions).                    ToArray (); return Newaggregatehtmlstring (htmlstrings); }            }        }         Public VirtualIhtmlstring Position (stringPositionID,BOOLRequiremembershipauthentication,params string[] membershipgroups) {            if(PageContext.PageRequestContext.RequestChannel = =frontrequestchannel.design) {return NewPagedesignholder ( This, PositionID); }            Else            {                if(requiremembershipauthentication) {varPermission =NewPagepermission () {requiremember = requiremembershipauthentication, allowgroups =membershipgroups}; if(!permission. Authorize (Html.ViewContext.HttpContext.Membership (). GetMember ())) {return NewHtmlstring (""); }                }                returnPosition (PositionID); }        }
View Code

Here's a detailed explanation.

A total of 4 overloaded functions were:

Public virtual ihtmlstring Position (string PositionID)

Public virtual ihtmlstring Position (String PositionID, String defaultcontent)

Public virtual ihtmlstring Position (string PositionID, func<string> defaultcontentfunc)

Public virtual ihtmlstring Position (string PositionID, bool requiremembershipauthentication, params string[] membershipgroups)

If you do not understand here, please refer to the following knowledge:

1.positionID means the ID of your HTML element.

2. If you do not understand the () = Defaultcontent), you can see here

3. For func<string> do not understand can see here

Kooboo Cms-html.fronthtml.position Detailed

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.