Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to overlap two labels(at the exactly same location) in asp.net 3.5?
Posted

Actually its not required to overlap the labels in ASP.NET ( as you do in Winforms). You can change the label text using javascript or from the server side and the same label will seem to be overlapped.

You can ofcourse overlap the labels by placing them into the different divs and applying the left: styles to it. However I wont recommend it since it will work differently in different browsers.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-Oct-11 19:17pm    
Why do you think overlapping the labels in WinForms is any good? Just a stupid idea which just passes in this library, but your idea of changing text is certainly better in all cases. I voted 4.
--SA
bbirajdar 12-Oct-11 5:53am    
hi SAK...I don't think that overlapping the labels in Winforms is a good idea and nowhere have I recommended it. However I have seen a lot of developers doing it.
When a person asks a question like overlapping the labels, it is for sure that he has worked in Winforms and looking for a similar solution in Webforms. Thats the reason I gave him an example just to help him visualize what he is looking for.

BTW, thanks for the vote.
Mabe there are other solutions, but i would do that this way:

You could set the position of the labels in css or inline in the style attribute, and the position:tabsulute has to be se.
the priority can be set with the z-index
 
Share this answer
 
Check out this generator. Use the "How close Together?" field to make the text overlap.
http://www.poqbum.com
/overlapingtxt/index.php?act=generate
[^]

Good luck!
 
Share this answer
 
Keep both label in adjacent. First make visible = true for one label and make visible = false for another and vice-versa.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900