I need to know how to change the css class on a tag on page load.. in PHP this was much easier all i had to do is to write <tagNAme class="<?php echo "className"; ?>">
...
I was able to write php code blockes with in tags.. but in ASP .NET this doesn't seem to work
I tried <% tagElementId.attribute.add("class","cssName"); %>
after the tag i wanted to change the css in ASPX file....but didn't work..
My scanario is i need to check password textbox and on login button click..if the password is wrong password textbox should have a class called "error" otherwise a css class named "userinput"
How do I do it?
EDIT
<form id="loginPanel" runat="server">
<ul>
<li>
<h3>
Log on</h3>
</li>
<li>
<label for="userId">
User ID :</label>
<asp:TextBox ID="userId" name="userId" class="loginTextInput" runat="server"></asp:TextBox>
</li>
<li>
<label for="password">
Password :</label>
<asp:TextBox ID="password" name="password" class="loginTextInput"
runat="server" ontextchanged="password_TextChanged"></asp:TextBox>
</li>
<li>
<asp:Button ID="logInButton" runat="server" Text="Log on" OnClick="logInButton_Click" />
<li class="forgotUserText">Forgot <a href="#" class="forgotUser">User ID </a>or <a
href="#" class="forgotUser">Password?</a> </li>
</ul>
</form>
`