Click here to Skip to main content
Rate this: bad
good
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 at 17-Jan-13 6:59am
   
<hr runat="server" id="hrStyle" /> works.....
 
there's no tag like asp:hr to my knowledge
shabari7 at 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
0 OriginalGriff 555
1 Sergey Alexandrovich Kryukov 305
2 BillWoodruff 259
3 CPallini 220
4 PIEBALDconsult 220
0 Sergey Alexandrovich Kryukov 10,615
1 Maciej Los 5,354
2 OriginalGriff 5,254
3 CPallini 3,719
4 BillWoodruff 3,476


Advertise | Privacy | Mobile
Web02 | 2.8.141029.1 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2014
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