This is a migrated thread and some comments may be shown as answers.

Show or Hide Div/Panel if Editor has no content.

2 Answers 186 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sayitfast
Top achievements
Rank 2
Iron
sayitfast asked on 23 Aug 2008, 12:36 AM
Hello,

I have a editor inside a div or even a panel. If the editor has no content I want to make the set the div visibility to false.

I have set the div as a server contol but not sure how or what the syntax is to find if the editor is emply.

Any help would be appreciated.

Thanks

2 Answers, 1 is accepted

Sort by
0
Kevin Babcock
Top achievements
Rank 1
answered on 25 Aug 2008, 03:03 AM
Hello Sayitfast,

You can check the Contents property of the RadEditor to see if has any text/markup. If you set the div to runat="server" you can reference it directly by its ID and set its Visible property to false.

if (String.IsNullOrEmpty(RadEditor1.Content)) 
    divEditor.Visible = false


I hope this helps.

Regards,
Kevin Babcock
0
sayitfast
Top achievements
Rank 2
Iron
answered on 25 Aug 2008, 07:24 PM
Thank you... works perfect.   Woo hoo!
Tags
General Discussions
Asked by
sayitfast
Top achievements
Rank 2
Iron
Answers by
Kevin Babcock
Top achievements
Rank 1
sayitfast
Top achievements
Rank 2
Iron
Share this question
or