The asp.net of the skin change to the following process:
Take Skin-displayuserwelcome.ascx as an example (whether this is a login status display)
1, view-forumgroupview.ascx file introduced Aspnetforums.controls alias for forums
2, in the hope that "whether the landing status" display where the use of
AspNetForums.Controls.DisplayUserWelcome
3, in the Displayuserwelcome class to do
A, set the name of the skin skinfilename
B, overriding the Initializeskin (control skin) function to implement controls on the skin
C, if the operation with the CreateChildControls () of the Skinnedforumwebcontrol class differs, you also need to override CreateChildControls (), but you can write only the difference section and then call it with base.
D, if the control has an event, you also need to write an event
4, in the skin needs to set the control display layout, the control name should be the same as the control name implemented in the Displayuserwelcome class
The Skinnedforumwebcontrol class is a vital class in the skin-changing process, and he uses the INamingContainer interface to differentiate controls and to compound controls by overriding CreateChildControls ().
Note: CreateChildControls () will be called by default (), and OnPreRender () will be invoked at FindControl () ()/* to invoke */findcontrol ()/* before page rendering OnPreRender Find a control * *
At the moment I found only three types of skin in Aspnetforums,
1, Masterpage.ascx as the representative of the general framework of skin
2, View-forumgroupview.ascx as the representative of the skin containers
3, Skin-displayuserwelcome.ascx as the representative of the functional skin
So if you want to change the position of a block in a page, then you should modify the skin container, and if you want to change the interior of a piece of the layout you need to modify the function of the skin in the Default.aspx about the following several user controls
Delfault.aspx
view-forumgroupview.ascx//The overall layout of the home page
Skin-loginsmall.ascx//landed on that piece.
skin-navigationmenu.ascx//Menu
skin-banner.ascx//custom, Position on top of menu
skin-displayuserwelcome.ascx//State
skin-displaytitle.ascx//statement
skin-statistics.ascx//Statistical information
skin-whoisonline.ascx//Online Information
skin-displaylegendforum.ascx//Forum Legend
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.