Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > On/Off control

Reply
Thread Tools

On/Off control

 
 
Peter Zolja
Guest
Posts: n/a
 
      12-10-2003
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.


 
Reply With Quote
 
 
 
 
Sink
Guest
Posts: n/a
 
      12-10-2003
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

>-----Original Message-----
>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.
>
>
>.
>

 
Reply With Quote
 
 
 
 
Sink
Guest
Posts: n/a
 
      12-11-2003
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
>-----Original Message-----
>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.
>
>
>.
>

 
Reply With Quote
 
Peter Zolja
Guest
Posts: n/a
 
      12-11-2003
> // 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Control to Control Other User Control Jonathan Wood ASP .Net 4 02-02-2010 03:41 PM
Control, Web Control and Composite Control shapper ASP .Net 6 12-26-2007 02:49 PM
persisting changes to a control outside a user control from the user control? Mad Scientist Jr ASP .Net 0 03-22-2006 08:02 AM
HTML Client Control versus. HTML Server Control versus. Web Server Control Matthew Louden ASP .Net 1 10-11-2003 07:09 PM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com ASP .Net 0 07-01-2003 09:26 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57