473,399 Members | 3,038 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,399 software developers and data experts.

any way to hide/show line?

Hi I am trying to show and hide a line dynamically. I setup the line in HTML
using the HR tag but it does not have a visible attribute. Also it does not
allow run at server added to it. Thanks.
--
Paul G
Software engineer.
Nov 19 '05 #1
3 1860
Paul wrote:
Hi I am trying to show and hide a line dynamically. I setup the line in HTML
using the HR tag but it does not have a visible attribute. Also it does not
allow run at server added to it. Thanks.


use a PlaceHolder or even an IMG tag, specifying the height and width.
Heck, you could probably use a DIV or SPAN too

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #2
I assume its client side youre worrying about? If so then you can place
the HR tag inside a DIV tag and use some javascript to set the DIV's
visibility.

An alternative, if you can set/hide it through postbacks, is to use the
HtmlTextWriter class in System.Web.UI. Or simply use response.write and
spit out the HTML at runtime.

Paul wrote:
Hi I am trying to show and hide a line dynamically. I setup the line in HTML
using the HR tag but it does not have a visible attribute. Also it does not
allow run at server added to it. Thanks.

Nov 19 '05 #3
Actually, <HR> does allow Runat="Server". With Runat="Server", <HR> is an
instance of HtmlGenericControl which does have a Visible property. You
could also use .Style["display"] = "none" or "inline" if you still wanted it
to be rendered.

If you look at the documentation of HtmlGenericControl, you'll see that
there's an overload for the constructor that allows you to specify the tag
name so you can dynamically create tags such as <HR> on the fly. There's
also a TagName property for getting or setting the tag name as needed.

One thing to keep in mind is that ASP.NET pages aren't HTML, they're XHTML
and therefore, to be valid, all tags must have a close tag. The runtime
lets you get away with using HTML for non-server-side tags (because
everything not marked as a server tag is treated as a LiteralControl and
streamed to the browser "as is") but for server-side tags (anything marked
as runat="server") you will need the end tag. For tags like <HR>, when you
set Runat="Server", you'll need to write it like this:
<HR runat="server" id="Line1" /> or
<HR runat="server" id="Line1"></HR>

Personally, I prefer the first option because it's more concise.

HTH
----------------
Dave Fancher
http://www.davefancher.com

"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:FD**********************************@microsof t.com...
Hi I am trying to show and hide a line dynamically. I setup the line in
HTML
using the HR tag but it does not have a visible attribute. Also it does
not
allow run at server added to it. Thanks.
--
Paul G
Software engineer.

Nov 19 '05 #4

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

Similar topics

4
by: SpamProof | last post by:
I need to set my div tag (<div id="divBioBottom"> content </div>) to either visible or hidden from javascript. Does anyone know how to do this? Thanks. 7078895 /ra
19
by: benzwt | last post by:
I use the following function to hide a <div> named one. function hideObject() { if (ns4) { document.n1.visibility = "hide"; } else if (ie4) { document.all.style.visibility = "hidden"; }...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
3
by: Lynn | last post by:
Hello, I have a user control that contains a table, and some text fields. I would like to show or hide a particular row of this table, based on a selection the user makes on my page. Here's...
1
by: asilverpeach | last post by:
Hey Guys! Found some great scripts here on this topic but have to make to changes to the code that I can't seem to figure out. First, In the following code clicking on the headers shows the...
1
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
10
by: sara | last post by:
Hi - Is it possible to hide the detail section of a report at run time? I have a report that prints all details, with summary lines. The user would like the report ALSO with just summary lines....
18
by: ryrocks | last post by:
Hi, Im making a 'contact us' page. The user click on the div, this then reveals another larger div displaying more information giving the effect of the box expanding or dropping down. I have 3...
6
by: Doogie | last post by:
Hi I have an img control I am trying to hide upon certain types of commands in my code behind. When to hide it is directly tied to a asp:dropdownlist control. So depending on what the user...
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?
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:
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.