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
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