Welcome Guest Search | Active Topics | Sign In | Register

Editor object not available in code Options
John Wiles
Posted: Thursday, December 18, 2008 7:15:36 AM
Rank: Member
Groups: Member

Joined: 9/17/2008
Posts: 13
I'm using the code below to create an editor, but when I tried to use "edtNotes.Html" in the .aspx.cs file (or even in the same .aspx file), I get a "CS0103: The name 'edtNotes' does not exist in the current context" error when I try to run it.

Can you please show me how to get the 'edtNotes' object to be available in code?

Thanks,

John Wiles

------------- CODE -----------------------

<eo:Editor ID="edtNotes" runat="server" FooterVisible="false" ToolBarSet="Custom">
<EditAreaStyle CssText="border-bottom-color:#aaaaaa;border-bottom-style:solid;border-bottom-width:1px;border-left-color:black;border-left-style:solid;border-left-width:1px;border-right-color:black;border-right-style:solid;border-right-width:1px;border-top-color:black;border-top-style:solid;border-top-width:1px;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;"></EditAreaStyle>
<CustomHeaderTemplate>
<eo:ToolBar runat="server" SeparatorImage="00100304">
<ItemTemplates>
<eo:ToolBarItem Type="Custom">
<HoverStyle CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;"></HoverStyle>
<DownStyle CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;"></DownStyle>
<NormalStyle CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;"></NormalStyle>
</eo:ToolBarItem>
</ItemTemplates>
<HoverStyle CssText="border-right: #335ea8 1px solid; padding-right: 3px; border-top: #335ea8 1px solid; padding-left: 3px; padding-bottom: 2px; border-left: #335ea8 1px solid; padding-top: 2px; border-bottom: #335ea8 1px solid; background-color: #c2cfe5; cursor:hand; FONT-SIZE: 12px; FONT-FAMILY: Tahoma;"></HoverStyle>
<DownStyle CssText="border-right: #335ea8 1px solid; padding-right: 2px; border-top: #335ea8 1px solid; padding-left: 4px; padding-bottom: 1px; border-left: #335ea8 1px solid; padding-top: 3px; border-bottom: #335ea8 1px solid; background-color: #99afd4; cursor:hand; FONT-SIZE: 12px; FONT-FAMILY: Tahoma;"></DownStyle>
<NormalStyle CssText="padding-right: 4px; padding-left: 4px; padding-bottom: 3px; border-top-style: none; padding-top: 3px; border-right-style: none; border-left-style: none; border-bottom-style: none; cursor:hand; FONT-SIZE: 12px; FONT-FAMILY: Tahoma;"></NormalStyle>
<Items>
<eo:ToolBarItem ToolTip="Bold" ImageUrl="00101011" CommandName="Bold"></eo:ToolBarItem>
<eo:ToolBarItem ToolTip="Italic" ImageUrl="00101012" CommandName="Italic"></eo:ToolBarItem>
<eo:ToolBarItem ToolTip="Underline" ImageUrl="00101013" CommandName="Underline"></eo:ToolBarItem>
<eo:ToolBarItem Type="Separator"></eo:ToolBarItem>
<eo:ToolBarItem ToolTip="Align Left" ImageUrl="00101014" CommandName="AlignLeft"></eo:ToolBarItem>
<eo:ToolBarItem ToolTip="Align Center" ImageUrl="00101015" CommandName="AlignCenter"></eo:ToolBarItem>
<eo:ToolBarItem ToolTip="Align Right" ImageUrl="00101016" CommandName="AlignRight"></eo:ToolBarItem>
<eo:ToolBarItem Type="Separator"></eo:ToolBarItem>
<eo:ToolBarItem ToolTip="Design Mode" ImageUrl="00101051" CommandName="DesignMode"></eo:ToolBarItem>
<eo:ToolBarItem ToolTip="HTML Mode" ImageUrl="00101052" CommandName="HTMLMode"></eo:ToolBarItem>
</Items>
</eo:ToolBar>
</CustomHeaderTemplate>
</eo:Editor>
John Wiles
Posted: Thursday, December 18, 2008 10:00:19 AM
Rank: Member
Groups: Member

Joined: 9/17/2008
Posts: 13
I solved my problem.

The C# line:

EO.Web.Editor objEdtNotes = (EO.Web.Editor)loginViewNotes.FindControl("edtNotes");

Encapsulates 'edtNotes' in 'objEdtNotes' which is accessible to the code. This was necessary because 'edtNotes' was inside a LoginView container.
eo_support
Posted: Thursday, December 18, 2008 1:58:20 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Great. Thanks for the update!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.