473,395 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

trying to use <div> to hide a bunch of table rows

I attempted the following

<div id="div" runat="server">
<tr><td></td></tr>
<tr><td></td></tr>
</div>

This is to hide a group of rows depending on some business rules in my code
behind.

It works. BUT.

When I go back to the aspx page, VS.NET has f*d it up by inserting the
</div> tag.

<div id="div" runat="server"></div>
<tr><td></td></tr>
<tr><td></td></tr>
<div></div>

Note to Microsoft. DO NOT EVER DO ME A FAVOR. NEVER ASKED FOR IT, SO
PLEEEEEESE.

Sorry... just had to get it off the chest. Obvously the editor does not
like what it sees and it "corrects" what it does not like. What do you
advise? I have a table with a bunch of rows that encapsulate fields. Under
certain business rules, I would like to hide a group of rows. I suppose I
could do this row by row, but that is a lot of work...
Nov 18 '05 #1
4 2340
Hi David,

I know the visual studio.net does the reformatting of the html tags.. but
there is a good news for you that will no more be there in the Next version
Visual Studio 2005 based on the users feedback this is taken care in
Whidbey.

Right now my suggestion would be to use place holder controls if you are
facing too much problems with the html formatting using DIC or in Visual
Studion you take a look at the settings for

Options->Text Editor->Html-Xml->HTML Specific and see the autor insert
section.

Regards
Ashish M Bhonkiya
"David" <sp************@spammersgohome.com> wrote in message
news:4c***************@twister.socal.rr.com...
I attempted the following

<div id="div" runat="server">
<tr><td></td></tr>
<tr><td></td></tr>
</div>

This is to hide a group of rows depending on some business rules in my code behind.

It works. BUT.

When I go back to the aspx page, VS.NET has f*d it up by inserting the
</div> tag.

<div id="div" runat="server"></div>
<tr><td></td></tr>
<tr><td></td></tr>
<div></div>

Note to Microsoft. DO NOT EVER DO ME A FAVOR. NEVER ASKED FOR IT, SO
PLEEEEEESE.

Sorry... just had to get it off the chest. Obvously the editor does not
like what it sees and it "corrects" what it does not like. What do you
advise? I have a table with a bunch of rows that encapsulate fields. Under certain business rules, I would like to hide a group of rows. I suppose I
could do this row by row, but that is a lot of work...

Nov 18 '05 #2
Actually, it is de-f*ing your improper HTML.

If you think the editor doesn't like it, you'll just love what some browsers
will do with it.

Bob Lehmann

"David" <sp************@spammersgohome.com> wrote in message
news:4c***************@twister.socal.rr.com...
I attempted the following

<div id="div" runat="server">
<tr><td></td></tr>
<tr><td></td></tr>
</div>

This is to hide a group of rows depending on some business rules in my code behind.

It works. BUT.

When I go back to the aspx page, VS.NET has f*d it up by inserting the
</div> tag.

<div id="div" runat="server"></div>
<tr><td></td></tr>
<tr><td></td></tr>
<div></div>

Note to Microsoft. DO NOT EVER DO ME A FAVOR. NEVER ASKED FOR IT, SO
PLEEEEEESE.

Sorry... just had to get it off the chest. Obvously the editor does not
like what it sees and it "corrects" what it does not like. What do you
advise? I have a table with a bunch of rows that encapsulate fields. Under certain business rules, I would like to hide a group of rows. I suppose I
could do this row by row, but that is a lot of work...

Nov 18 '05 #3
I have been using ASP Panels for this type of thing, because of the issue
you are running into. Replace your divs with panels, and you can set the
visible property true or false.
"David" <sp************@spammersgohome.com> wrote in message
news:4c***************@twister.socal.rr.com...
I attempted the following

<div id="div" runat="server">
<tr><td></td></tr>
<tr><td></td></tr>
</div>

This is to hide a group of rows depending on some business rules in my code behind.

It works. BUT.

When I go back to the aspx page, VS.NET has f*d it up by inserting the
</div> tag.

<div id="div" runat="server"></div>
<tr><td></td></tr>
<tr><td></td></tr>
<div></div>

Note to Microsoft. DO NOT EVER DO ME A FAVOR. NEVER ASKED FOR IT, SO
PLEEEEEESE.

Sorry... just had to get it off the chest. Obvously the editor does not
like what it sees and it "corrects" what it does not like. What do you
advise? I have a table with a bunch of rows that encapsulate fields. Under certain business rules, I would like to hide a group of rows. I suppose I
could do this row by row, but that is a lot of work...

Nov 18 '05 #4
Hi

This is not valid html so don't blame MS ;)

Try giving the <tr> you want to hide/display the same name

<tr name="myStuff"><td></td></tr>
<tr name="myStuff"><td></td></tr>

then to show..

function toggle(){
var e = document.getElementsByName("myStuff");
if(e != null)
{
// Get current status
var sDisplay = ( e.style.display == "none" ) ? "block" : "none";
for(i=0;i<e.length;i++)
{
e[i].style.display = sDisplay;
}
}
}

More info:
http://msdn.microsoft.com/library/de...ence_entry.asp

--
Best Regards
Vidar Petursson
==============================
Microsoft Scripting MVP
http://www.microsoft.com/technet/scriptcenter
==============================
"David" <sp************@spammersgohome.com> wrote in message
news:4c***************@twister.socal.rr.com...
I attempted the following

<div id="div" runat="server">
<tr><td></td></tr>
<tr><td></td></tr>
</div>

This is to hide a group of rows depending on some business rules in my
code
behind.

It works. BUT.

When I go back to the aspx page, VS.NET has f*d it up by inserting the
</div> tag.

<div id="div" runat="server"></div>
<tr><td></td></tr>
<tr><td></td></tr>
<div></div>

Note to Microsoft. DO NOT EVER DO ME A FAVOR. NEVER ASKED FOR IT, SO
PLEEEEEESE.

Sorry... just had to get it off the chest. Obvously the editor does not
like what it sees and it "corrects" what it does not like. What do you
advise? I have a table with a bunch of rows that encapsulate fields.
Under
certain business rules, I would like to hide a group of rows. I suppose I
could do this row by row, but that is a lot of work...

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul Thompson | last post by:
When I put a <div ...> inside a <table> specification, functionality is not there. When I put the <table> inside the <div> everything works. Why is that?
3
by: KathyB | last post by:
Hi, totally new to the div show/hide thing. I have some rows in a table. When I first load the page, I only want to see divs where the divID=ForView. When I load now, I see BOTH rows...even...
8
by: F. Da Costa | last post by:
Following is a snippet of html in which I hide a whole table and try to hide a single row. Here is my question (plz don't chew my head off if its css related instead): Why does the divTable...
61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
7
by: Herbman | last post by:
Hi, I'm trying to position a <tr> ("row") element with CSS. The table itself is positioned with <div> tags. The problem is when I use <div> tags to position the rows within the table nothing...
19
by: CMAR | last post by:
I have the following markup. The problem is that the browser, e.g., IE6, inserts several lines of blank space between the <div> and the following table. Is there a way to minimize that vertical...
1
by: Sean | last post by:
I have a table (with tabular data) that I want to display on a webpage. Initially the talbe is empty. When a user clicks on a button, a child window opens up with a form and some text fields. ...
6
by: cargo303 | last post by:
I have a php page with a drop down list, and the default selected option is "Select a location" (without quotes). Using the drop down initiates a database query. One of (3) things should happen: ...
8
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.