У метода Replace есть 2 набора параметров:
- либо меняем CHAR на CHAR
- либо STRING на STRING
Сделал так:
protected void grid_news_RowDataBound(object sender, GridViewRowEventArgs e)
{
char c = (char)13;
string s = Convert.ToString(c);
((Label)e.Row.FindControl("label_news_text")).Text.Replace(s,"<br>");
}
Возникает ошибка:
Object reference not set to an instance of an object.А как использовать класс в своём проекте?
Создал новый класс, добавил в него приведёный код. При компиляции пишутся ошибки:
The type or namespace name 'Match' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'Bindable' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'Category' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'DefaultValue' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'Localizable' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'DefaultProperty' could not be found (are you missing a using directive or an assembly reference?)Видимо нужно подсоединить какие-то нэймспэйсы. А какие?