M
Mirek Endys
Hi all,
I thought, that this is an usual thing, but Im wrong.
I have a DataList control and there is a Label control. I need to change the
Text propertz of the Label control. How to do it.
Here is my function I want to use, but it is not working. I can Find Label
in DataListItem, but the change is not dispalyed.
public void ConnectionCheck(DataListItem dlItem, string connection)
{
Label lblSourceConnectionStringStatus =
(Label)dlItem.FindControl("lblSourceConnectionStringStatus");
if(!Check(connection))
{
lblSourceConnectionStringStatus.Text = "Connection Error";
lblSourceConnectionStringStatus.ForeColor =
System.Drawing.Color.Red;
}
else
{
lblSourceConnectionStringStatus.Text = "Connection OK";
lblSourceConnectionStringStatus.ForeColor =
System.Drawing.Color.Green;
}
}
protected void dlDTDefinitions_ItemCommand(object source,
DataListCommandEventArgs e)
{
CheckConnections(e.Item);
}
What shoud I to do to display new value of the text properties?
Thanks
Mirek
I thought, that this is an usual thing, but Im wrong.
I have a DataList control and there is a Label control. I need to change the
Text propertz of the Label control. How to do it.
Here is my function I want to use, but it is not working. I can Find Label
in DataListItem, but the change is not dispalyed.
public void ConnectionCheck(DataListItem dlItem, string connection)
{
Label lblSourceConnectionStringStatus =
(Label)dlItem.FindControl("lblSourceConnectionStringStatus");
if(!Check(connection))
{
lblSourceConnectionStringStatus.Text = "Connection Error";
lblSourceConnectionStringStatus.ForeColor =
System.Drawing.Color.Red;
}
else
{
lblSourceConnectionStringStatus.Text = "Connection OK";
lblSourceConnectionStringStatus.ForeColor =
System.Drawing.Color.Green;
}
}
protected void dlDTDefinitions_ItemCommand(object source,
DataListCommandEventArgs e)
{
CheckConnections(e.Item);
}
What shoud I to do to display new value of the text properties?
Thanks
Mirek