开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜