473,386 Members | 1,819 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,386 software developers and data experts.

Make HtmlControl invisible

If i have an HtmlControl for a table row such as:

<tr id="trMyRow" runat="server">...</tr>

is there any way to set this to be invisible by default through the HTML
code, without having to go through the codebehind?

<tr id="trMyRow" runat="server" visible="false">...</tr> does not work.

its kind of a pain to have to put a whole bunch of lines like

trMyRow.Visible = false;

for each one i want to be invisible by default.

Any help is appreciated.
Thanks in advance,

-Tim
Nov 18 '05 #1
5 4817
One option is to use the CSS:
<tr id="trMyRow" runat="server" style="display:none;">...</tr>

"Tim Mulholland" <Ti***********@nospamaddress.com> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
If i have an HtmlControl for a table row such as:

<tr id="trMyRow" runat="server">...</tr>

is there any way to set this to be invisible by default through the HTML
code, without having to go through the codebehind?

<tr id="trMyRow" runat="server" visible="false">...</tr> does not work.

its kind of a pain to have to put a whole bunch of lines like

trMyRow.Visible = false;

for each one i want to be invisible by default.

Any help is appreciated.
Thanks in advance,

-Tim

Nov 18 '05 #2
Add a style class with display:none
"Tim Mulholland" <Ti***********@nospamaddress.com> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
If i have an HtmlControl for a table row such as:

<tr id="trMyRow" runat="server">...</tr>

is there any way to set this to be invisible by default through the HTML
code, without having to go through the codebehind?

<tr id="trMyRow" runat="server" visible="false">...</tr> does not work.

its kind of a pain to have to put a whole bunch of lines like

trMyRow.Visible = false;

for each one i want to be invisible by default.

Any help is appreciated.
Thanks in advance,

-Tim

Nov 18 '05 #3
to undo that, i'll have to edit the style, right? i won't be able to use the
visible property?
hmm. iguess i can just test that myself...

"Shiva" <sh******@online.excite.com> wrote in message
news:uO**************@TK2MSFTNGP09.phx.gbl...
One option is to use the CSS:
<tr id="trMyRow" runat="server" style="display:none;">...</tr>

"Tim Mulholland" <Ti***********@nospamaddress.com> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
If i have an HtmlControl for a table row such as:

<tr id="trMyRow" runat="server">...</tr>

is there any way to set this to be invisible by default through the HTML
code, without having to go through the codebehind?

<tr id="trMyRow" runat="server" visible="false">...</tr> does not work.

its kind of a pain to have to put a whole bunch of lines like

trMyRow.Visible = false;

for each one i want to be invisible by default.

Any help is appreciated.
Thanks in advance,

-Tim

Nov 18 '05 #4
Hi Tim,

As for the HtmlControl ,we can also set the "Visible" property inline
within the aspx page template, for example:

<table width="100%" border="1">
<tr id="trOne" runat="server" Visible="false">
<td>Table Row One</td>
</tr>

..................

Also, if you use the CSS style such as ,
<table width="100%" border="1">
<tr id="trOne" runat="server" style="display:none">
<td>Table Row One</td>
</tr>

then, you can use the

trOne.Style["display"] = "inline";
to reset it.

Hope this help. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #5
I could swear i had tested that before and it didn't work.
But, alas, it does!
Thanks so much.

-Tim

"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:DX**************@cpmsftngxa06.phx.gbl...
Hi Tim,

As for the HtmlControl ,we can also set the "Visible" property inline
within the aspx page template, for example:

<table width="100%" border="1">
<tr id="trOne" runat="server" Visible="false">
<td>Table Row One</td>
</tr>

.................

Also, if you use the CSS style such as ,
<table width="100%" border="1">
<tr id="trOne" runat="server" style="display:none">
<td>Table Row One</td>
</tr>

then, you can use the

trOne.Style["display"] = "inline";
to reset it.

Hope this help. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #6

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

Similar topics

3
by: Matt | last post by:
Are there any settings to make a page invisible to the user until certain time? For example, I want mypage.html is invisible to the user until 12:00am. But mypage.html is already in the IIS server....
7
by: Geoff Cox | last post by:
Hello, I have a button which I wish to be invisible at the end of an application. How do delete it or simply make it invisible? Cheers Geoff
3
by: Susan Bricker | last post by:
Greetings. I have three forms that are open at the same time. They are related and cascading. The first form (frmEventAdd) is the anchor. Each event can have many Trials. The second form is...
0
by: Hutch | last post by:
I am looking for some thoughts on this. I have successfully gotten the HTMLControl to work using C#, and it is displaying HTML and receiving messages nicely. Unfortunately, I am not able to...
3
by: Richard | last post by:
After printing a userlist to a Datagrid i want some names not to be shown. I want to know how i can make a entire datagrid row invisible. I suspect its something with the OnItemDatabound but i am...
4
by: NH | last post by:
Hi, I just cannot get this to work. I want to make a cell editable in a datagrid only if the value of another cell is something specific. I am able to capture the value of the other cell via the...
4
by: michael.schwarz | last post by:
Hello, is it possible to get a HtmlControl from a string including the HTML code in .NET 2.0? I was using the TemplateControl.ParseControl method in .NET 1.1, but this is not working in the new...
1
by: CharlesA | last post by:
Hi folks I want to add a <ul> list with some <li> items in .net code behind on the fly I was under the impression that you could instantiate any HTML control by using the HTMLControl class...
7
by: Nader | last post by:
It's easy to make the last row in a datagrid (filled with a table) invisible: datagridObject.Rows.Visible = false BUT if 'i' is not the last row then things go wrong. I even tried: for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.