Setting RowSpan during run time in aspx file

G

Gawel

I need necessarily set RowSpan(ColSpan) property of cell in aspx file(not in
cs file).
But below statement does not work :(.
Any idea ?

<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="1"
runat="server">
<TR>
<TD RowSpan="<%# 3 %>">a</TD>
<TD>a</TD>
<TD>a</TD>
</TR>
<TR>
<TD>a</TD>
<TD>a</TD>
</TR>
<TR>
<TD>a</TD>
<TD>a</TD>
</TR>
</TABLE>


Thanks in advance


Gawel
 
R

Rob T

Try doing something like this:

<td id=tdRow runat=server>a</td>

then in your codebehind, you can set any of the properties of that TD.
 
G

Gawel

Try doing something like this:
<td id=tdRow runat=server>a</td>
then in your codebehind, you can set any of the properties of that TD.


Unfortunately, I can NOT use codebehind(cs) files. :(

Gawel
 
G

Gawel

try:
<TD RowSpan="<%=varOrFunctionCall %>">a</TD>

Unfortunaltely it does not work :(.
For:
<TD RowSpan="<%=3 %>">a</TD>
I got run time error:
<%=3%> is not a valid value for Int32.

Gawel
 
G

Gawel

I found the solution.
Below statemant works great but one MUST invoke any DataBind() method. It
can
be even this embedded in Page class.

TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300"
runat="server">
<TR>
<TD RowSpan="<%# 3 %>">a</TD>
<TD>a</TD>
<TD>a</TD>
</TR>
<TR>
<TD>a</TD>
<TD>a</TD>
</TR>
<TR>
<TD>a</TD>
<TD>a</TD>
</TR>
</TABLE>


Gawel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top