|
hi , im sorry for the subject name i didnt found sth else to write it to .
i have two forms , master page/form and default page/form .
when i run the website some of the element in the default page are not correct . i mean is like i didnt defined any css property for it .
but i figure out sth , when im using the id for a particular element and the element is type of asp not html i mean start with <asp:element name="" runat:server="" id="button">
if i set a css for it with an id
like
#button {sth,sth,sth}
is not work pretty fine in the default page .
but if i used the class and internal css for that element . is work pretty fine.
look at this
<asp:element name="" runat:server="" class="button" id="button">
.button{sth,sth,sth}-------------->> it works pretty fine in the default
and this one too
<asp:element name="" runat:server="" style="sth,sth,sth" id="button">
but is not working fine with the id . i dont know why.
i dont know if this place is the right place for asking this type of qustion or not.
but i'll appreciate if you suggest me any thing that help me out.
and i'm sorry for my poor english.
|
|
|
|
|
You are correct the style sheets for element id seems to not work. This is because asp controls are by default renderend with name and id attributes set to unique values.
As a result you don't have to worry about having <asp:button id="Button"> on master page, content page and 3 copies of the same user control - they all will get different id, avoiding problems with html validation and event handling.
If you absolutely have to use css with id and you know 100% there will be no other control with the same ID, you can set ClientIDMode="static", however I would encourage using css class instead (set with "CssClass" attribute for asp controls, not "class" as in your example".
On final note, you can check exact id and other properties of rendered page using F12 tool in most browsers.
--
"My software never has bugs. It just develops random features."
|
|
|
|