PDA

View Full Version : [CLOSED] Change IndicatorIconCls dynamically not works



xeo4.it
Jun 23, 2014, 10:24 AM
Hi,
See my example, I need to change the indicator icon class dynamically, but I don't succeed.
Please help me
Thank you



<%@ Page Language="C#" %>


<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>


<!DOCTYPE html>


<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
txtF.IndicatorIconCls = "iconHelpRed";
}
</script>


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style>


.iconHelpRed {
background-image: url(../Images/help-red.png);
}
</style>



</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager runat="server" />


<ext:TextField id="txtF" runat="server" Width="300" IndicatorIcon="BulletRed" />


</form>
</body>
</html>

Daniil
Jun 23, 2014, 10:54 AM
Hi Jimmy,

The IndicatorIcon and IndicatorIconCls properties are not supposed to be used together.

You can do:

protected void Page_Load(object sender, EventArgs e)
{
txtF.IndicatorIconCls = "iconHelpRed";
txtF.IndicatorIcon = Icon.None; // in this case it won't be rendered to client
}

Or remove IndicatorIcon in the markup and set it in code behind as well at a certain condition.

xeo4.it
Jun 24, 2014, 7:03 AM
Hi Daniil,
It works fine.
Thank you very much.

Jimmy