如何将公用代码代码包含在aspx文件中
由于多个aspx文件需要使用如下一段代码,如何把它方便的包含进去
<COMPONENTART:MENU id= "MenuMain " runat= "server " Orientation= "Horizontal " DefaultGroupCssClass= "MenuGroup "
DefaultItemLookID= "DefaultItemLook " ImagesBaseUrl= "images/ " EnableViewState= "false " ExpandDelay= "100 "
DefaultGroupItemSpacing= "1 " CssClass= "TopGroup " SiteMapXmlFile= "xml/menuData.xml ">
<ITEMLOOKS>
<ComponentArt:ItemLook CssClass= "TopMenuItem " LabelPaddingBottom= "2 " LabelPaddingTop= "2 " LabelPaddingRight= "10 "
LabelPaddingLeft= "10 " HoverCssClass= "TopMenuItemHover " LookID= "TopItemLook "> </ComponentArt:ItemLook>
<ComponentArt:ItemLook CssClass= "MenuItem " LabelPaddingBottom= "5 " LabelPaddingTop= "5 " LabelPaddingRight= "10 "
LabelPaddingLeft= "10 " HoverCssClass= "MenuItemHover " LookID= "DefaultItemLook " LeftIconHeight= "18 " LeftIconWidth= "20 "
ExpandedCssClass= "MenuItemHover "> </ComponentArt:ItemLook>
</ITEMLOOKS>
</COMPONENTART:MENU>
------解决方案--------------------做一个用户控件 UserControl
把代码放用户控件
然后需要的页面使用这个用户控件
------解决方案--------------------用户控件