Repetitive code
<telerik:RadEditor ID="Editor1" runat="server">
<CssFiles>
<telerik:EditorCssFile value="../Skins/CustomSkin/Editor.CustomSkin.css"/>
<telerik:EditorCssFile value="../Skins/CustomSkin/Editor.CustomSkin.css"/>
<telerik:EditorCssFile value="../Skins/CustomSkin/Editor.CustomSkin.css"/>
</CssFiles>
</telerik开发者_Python百科:RadEditor>
<telerik:RadEditor ID="Editor2" runat="server">
<CssFiles>
<telerik:EditorCssFile value="../Skins/CustomSkin/Editor.CustomSkin.css"/>
<telerik:EditorCssFile value="../Skins/CustomSkin/Editor.CustomSkin.css"/>
<telerik:EditorCssFile value="../Skins/CustomSkin/Editor.CustomSkin.css"/>
</CssFiles>
</telerik:RadEditor>
<telerik:RadEditor ID="Editor3" runat="server">
<CssFiles>
<telerik:EditorCssFile value="../Skins/CustomSkin/Editor.CustomSkin.css"/>
<telerik:EditorCssFile value="../Skins/CustomSkin/Editor.CustomSkin.css"/>
<telerik:EditorCssFile value="../Skins/CustomSkin/Editor.CustomSkin.css"/>
</CssFiles>
</telerik:RadEditor>
How do I get rid of this repetitive code? I need to define "CSsFiles" somewhere in my code only once and not thrice like above, then use that function or whatever for ALL the Editor controls on my page
Make a web user control which wraps the RadEditor, and use that instead of using the RadEditor directly.
Is this a real question?
First, how about you delete the duplicates?
Second, use a "UserControl" to reuse the definition of RadEditor.
精彩评论