I need vertical label ( ASP.NET )

  • Thread starter Thread starter Hekim MUKUS
  • Start date Start date
Hekim said:
Hi,

i need vertical label.
C# or VB

thanks

You can do this only with graphics: html doesn't support the notion
of vertical tekst (as far as I know). Or maybe, if

t
h
i
s

is enough, add a <br> after each character.
 
Hekim MUKUS said:
Hi,

i need vertical label.
C# or VB

thanks
With CSS you can also use .... writing-mode:tb-rl
Here is a little example

<%@ Page Language="VB" Strict=True %>

<%@ import Namespace="System.Data" %>

<script language="VB" runat="server">
Sub Page_Load(byVal obj As Object, byVal e As EventArgs)
if not IsPostback
BindData()
end if
End Sub

sub BindData()
Dim dt As New DataTable()
Dim dr As DataRow
dt.Columns.Add(New DataColumn("StringValue", GetType(String)))
Dim i As Integer
For i = 0 To 9
dr = dt.NewRow()
dr(0) = "Item " & i.ToString()
dt.Rows.Add(dr)
Next i
Dim dv As New DataView(dt)
os0.datasource = dv
os0.databind

End sub
</script>
<style>
..test { writing-mode:tb-rl}


</style>

<html>
<body>
<div class="test">
Hello there
<form runat="server">
<asp:DataList id="os0" repeatcolumns="2" repeatDirecttion="horizontal"
runat="server">
<ItemTemplate>
<asp:label class="test" text='<%#
(DataBinder.Eval(Container.DataItem, "StringValue")) %>' runat="server" />
</ItemTemplate>
</asp:DataList>

</form>
<div>
</body>
</html>
 
Is this what you need?

style="writing-mode:tb-rl;"

it makes horizontal text vertical. i think that its really for handling
languages where text flows vertically, but it works great for those narrow
text headers!

jb
 
Microsoft provides DirectX Transformations that allow you to rotate
text. This may produce the effect you need however it will only work
with IE 5.5 and up, as all other browsers feel the need to shun any
technology that could be useful to web developers of all sorts.
 
Microsoft provides DirectX Transformations that allow you to rotate
text. This may produce the effect you need however it will only work
with IE 5.5 and up, as all other browsers feel the need to shun any
technology that could be useful to web developers of all sorts.

Or, rather, most all browser feel the need to adhere to web standards, which
is arguably much more useful than rogue browsers like IE whipping out
features willy-nilly (and, as always IE/PC centric...)

I do believe CSS3 has some provisions for rotated text. But, that's a ways
off...

-Darrel
 
You can rotate a label to any degree you wish by using Transitions.
It only works in IE.

Put this label on your page:

<asp:Label id="Label1" STYLE="position:absolute;
filter:progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto
expand')"
runat="server" onClick="fnSetRotation(this,90)">Label</asp:Label>

And put this Javascript in your page:
<SCRIPT><!-- fnSetRotation function -->
//oObj input requires that a matrix filter be applied.
//deg input defines the requested angle of rotation.
var deg2radians = Math.PI * 2 / 360;
function fnSetRotation(oObj, deg)
{ rad = deg * deg2radians ;
costheta = Math.cos(rad);
sintheta = Math.sin(rad);

oObj.filters.item(0).M11 = costheta;
oObj.filters.item(0).M12 = -sintheta;
oObj.filters.item(0).M21 = sintheta;
oObj.filters.item(0).M22 = costheta;

}
</SCRIPT>

Run it and click on the label to watch it change to vertical.
Here's more info:
http://msdn.microsoft.com/library/d.../author/dhtml/reference/properties/filter.asp
 
Thanks John Bankhead,

I'm a windows programmer. I learn ASP.NET (begginer).

Hekim MUKUS
 
Back
Top