I have a textbox in a Datalist with text that I get from a Database. There are alot of <br> in that text and I want linebreaks instead of <br>, This is what it looks like:
((TextBox)(EditProductList.Items[0].FindControl("txtEditDescription"))).Text.Replace("<br>", "\r\n");
<asp:DataList ID="EditProductList" runat="server">
<ItemTemplate>
<asp:TextBox ID="txtEditDescription" runat="server" TextMode="MultiLine" Height="350px"
Width="350px" Text='<%#Eval("Description") %>'></asp:TextBox>
</ItemTemplate>
</asp:DataList>
I get the text but I get the <br> as well.
You actually have to assign the string returned by
Replace()to theTextproperty again.