Click to See Complete Forum and Search --> : if statment with asp.net


waleed_89
11-16-2010, 01:51 PM
hi, this code in page html asp.net

<asp:Label ID="Label6" runat="server" ForeColor="Red" Font-Bold=true Text=<%# Eval("Service")%>/>

i need say:

if (Label6.Text = "admission")
{
Label6.Text = "tax"
}

i do,t know java script

please type full code to me.

thanks in advance
with my regards

Fang
11-17-2010, 06:38 AM
var Label6 = document.getElementById('Label6');
if (Label6.value == "admission")
{
Label6.value = "tax";
}

waleed_89
11-17-2010, 07:33 AM
i try but not work

Fang
11-17-2010, 07:56 AM
Use onblur in the control
onblur="if (this.value =='admission'){this.value='tax';}"

waleed_89
11-17-2010, 10:17 AM
i try this code but not work please help

<asp:Label ID="Label6" runat="server" ForeColor="Red" Font-Bold=true Text=<%# Eval("Service")%> onblur="if (this.value =='admission'){this.value='tax';}/>

Fang
11-18-2010, 01:30 AM
Moving to asp forum