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