On/Off control

P

Peter Zolja

Hi guys,

I am looking for a web control that would work in a similar way the Panel
works, except that it should not include any DIV tags in the HTML. What I
would like to do is to control blocks of HTML code from showing or not
showing (on the server side), i.e. whether they are included in the final
html code. The problem is that if I use the panel it inserts div tags, and
some browsers have issues with div tags between table rows or columns. Is
there a control that would do that, or a method to achieve this?

Thanks,
Peter.
 
S

Sink

Hi,
I ran into the same problem with the panel control and
two ways of delaing with it on a row level are:

1- Make sure you close previous tables, set your Panel
width, and make the first line in your Panel
another table def. Close the table right before the
end panel. This seesm to work fine.

2- Another way is to give a td an id and runat=server
and then you can control whether or not the td is
visible from the server. Collect some tds into a
user defined On/OFF method and you have a panel.
(with the second way, you don't need to worry about
about closing and opening tables and it seems to
work with any browser I have tried it on.)

Regards
Sink
 
S

Sink

Sorry,
Type to fast sometimes

// Synthetic Panel
<tr id="Row1" runat="server">...</tr>
<tr id="Row2" runat="server">...</tr>

private void TogglePanel(bool switch)
{
if(!switch){
Row1.Visible = false;
Row2.Visible = false;
}
else {
Row1.Visible = true;
Row2.Visible = true;
}

Add a static property and you also could track it and
switch from that.

Sink
 
P

Peter Zolja

// Synthetic Panel
<tr id="Row1" runat="server">...</tr>
<tr id="Row2" runat="server">...</tr>

That's awesome... I didn't know you can do that. The problem is that my
table is inside a repeater and the id is changed for every row in the list,
so I can't just call Row1 or Row2... As for your first suggestion
unfortunately it won't work for me because I have several tables
open/nested, and I am using the panel between rows, which is what confuses
other browsers (IE has no problem with this).

Thanks.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top