0

I have a table with subtables. I would like to get all the indexs of the rows by a css value. Is this possible from the code behind?

In this example I would like to know witch row number childRow has.

<table id="ctl00_contentHolder_tbl_main" class="tablesorter tablesorter-default" border="1" style="background-color:White;border-style:Solid;" rules="all">
<thead>
<tbody>
<tr class="grey">
<tr class="grey">
<tr class="grey">
<tr class="childRow">
<tr class="grey">
<tr class="grey">
1
  • 1
    CSS is just for styling. if you want to do any data related things, you have to use JavaScript Commented May 13, 2013 at 9:23

1 Answer 1

1

You can only work in code-behind with controls that have runat="server" ID="xxx" attributes. If a control has these attributes you can reference them and retrieve their attributes (including CSS class name). If not then the HTML code is treated as text by ASP.NET engine and not as elements/controls.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.