Well, before I can offer a solution I need a few pointers:
- are you intending to store the actual html in the database?
- you said you dont care about JS/HTML that can destroy layout, which makes
things easier
unless I'm mistaken I dont believe the "BoundColumns" in DataGrids change
the valid HTML to be Encoded HTML,
and since the repeater utilizes templates, then you are in better control.
In your repeater template, are you using "<asp:label runat=server text='<%#
DataBinder.Eval... %>'>"? if so then the Text property is automatically HTML
encoded, trying changing to using the HtmlControls, specifically the
HtmlGenericControl and setting the InnerHtml property, whereas this property
takes a string and outputs it verbatim.
HTH

Signature
Eric Newton
eric@ensoft-software.com
C#/ASP.net Solutions developer
> scenario: users can store data (guestbook entries, ther usernames and so on)
> on a database-driven website and i have to care about that they don't insert
[quoted text clipped - 23 lines]
> manually like i do now seems to be the worst answer since it makes much work
> and is error prone.
ViperDK \(Daniel K.\) - 16 Aug 2003 02:45 GMT
no i want to store all data as it is. if someone writes stuff like "i like
<i> tags" it should get 1:1 into the database and i want an easy way to
verify in the output that it does get encoded.
i usually use DataGrids with BoundColumns like
<asp:BoundColumn DataField="Comment" HeaderText="Comment"></asp:BoundColumn>
and yes i saw that the HtmlGenericControl has a property for the encodet and
the raw content. i wonder why the the TextBox WebControl hasn't that
functionality. thought they should be first choice.
> Well, before I can offer a solution I need a few pointers:
>
[quoted text clipped - 18 lines]
> eric@ensoft-software.com
> C#/ASP.net Solutions developer
Eric Newton - 22 Aug 2003 08:37 GMT
Yeah, I guess the textboxes were designed from the start to be HTML proper,
ie, if they have HTML in their text property then its HTMLEncoded so that
what is in the text is exactly what you see...
I would guess it'll always stay this way, but a simple boolean property
wouldnt hurt ;-)

Signature
Eric Newton
eric@ensoft-software.com
C#/ASP.net Solutions developer
> no i want to store all data as it is. if someone writes stuff like "i like
> <i> tags" it should get 1:1 into the database and i want an easy way to
[quoted text clipped - 33 lines]
> > eric@ensoft-software.com
> > C#/ASP.net Solutions developer