2.0 simplified data binding: cleanest way to strip formatting?

G

Guest

ASP.NET 2.0 simplifies binding datasources to controls like the repeater.
These new methods allow nearly code-less mechanisms to dump data to a page.
I like this new feature a whole lot.

HTML tags embedded in the source data are intepreteted by the web browser,
of course. In cases where invalid markup has made its way into our database,
this causes problems across the entire repeater presentation.

I'm wondering what the simplist and cleanest way to "scrub" the data of HTML
tagging might be in the context of ASPNET 2.0's new ultra-simplified
databinding. My code looks something like this:

<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$
ConnectionStrings:myConnectionString %>"
SelectCommand="SELECT [Con_Title], [Con_Summary] FROM
[Contentitems]"></asp:SqlDataSource>
</strong>
<asp:Repeater ID="Repeater2" runat="server"
DataSourceID="SqlDataSource2">

<ItemTemplate>
<b> <%# DataBinder.Eval(Container.DataItem, "Con_Title")%> </b> <br /> <%#
DataBinder.Eval(Container.DataItem, "Con_Summary")%> </ItemTemplate>

Any help out there? Much appreciated.

Thanks,
-KF
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top