Click here to Skip to main content
12,357,929 members (71,621 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
I would like to know how to use the hr whenever required for. How to give an ID to it.
My code:

<asp:hr id="hrcityleft" runat="server"
                hr style="z-index: 1; left: 240px; top: 195px; position: absolute; height: 0px;  width: 299px; background-color:Silver; "
               />

It is not working. Says: 'Unknown server tag asp:hr'.
Posted 17-Jan-13 0:44am
Comments
shabari7 17-Jan-13 6:59am
   
<hr runat="server" id="hrStyle" /> works.....

there's no tag like asp:hr to my knowledge
shabari7 17-Jan-13 7:00am
   
server side

hrStyle.visible = false; or hr.style.add("display","none|block");
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Hello
You can used like this
<hr runat="server" id="hr" style="z-index: 1; left: 240px; top: 195px; position: absolute; height: 0px;  width: 299px; background-color:Silver; " />
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

hi,

use this simple methoed-

function showORhide(obj) {
           if ($('#' + obj).length > 0) {
               if ($('#' + obj)[0].style.display == 'none') {
                   $('#' + obj).css('display', 'block');
               }
               else {
                   $('#' + obj).hide();
               }
           }
       }

with your code like -
<div id="divHr" style="display: none;">
                       <hr />
                   </div>
                   <input type="button" value="submit" onclick="showORhide('divHr')" />


it might help you
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100