I am using asp.net/C#
for my project.Currently i have a default.aspx
page and a master page.The default.aspx
page has many controls , and
The client ID is not equal to the ID property of a runat="server"
control. To get the ID on the client, you can use the ClientID property.
On newer ASP.NET versions (starting with version 4), there is also a ClientIDMode property to control the generation.
So to solve your issue, you could either set ClientIDMode
to ClientIDMode.Static
or somehow access the ClientID
property from code behind and put this value into your CSS definition.
Alternatively you could also:
div
) that has no runat="server"
and put an ID into this container control, changing your CSS to e.g. #txtContainer input{border:1px solid red}