ASP.Net/Mobile Control/Label — различия между версиями

Материал из .Net Framework эксперт
Перейти к: навигация, поиск
м (1 версия)
 
м (1 версия)
 
(нет различий)

Текущая версия на 11:52, 26 мая 2010

Mobile Label: bold, reference style (VB.net)

<%@ Page 
    Inherits="System.Web.UI.MobileControls.MobilePage" 
    Language="VB" 
%>
<%@ Register 
    TagPrefix="mobile" 
    Namespace="System.Web.UI.MobileControls" 
    Assembly="System.Web.Mobile" 
%>
<script runat="server" language="VB">
</script>
<mobile:Form id="Test" runat="server">
    <mobile:Label 
        runat="server"
        id="lblTitle"
        StyleReference="title" 
        Text="Title Text Style"
    />
    <mobile:Label 
        runat="server"
        id="lblError"
        Alignment="Center" 
        Text="The word <B>bold</B> is not in bold."
    />
    <mobile:TextView 
        runat="server"
        id="tvTextr"
        Text="The word<BR><B>bold</B><BR>is in bold."
    />
</mobile:Form>



Mobile label: font and alignment (VB.net)

<%@ Page 
    Inherits="System.Web.UI.MobileControls.MobilePage" 
    Language="VB" 
%>
<%@ Register 
    TagPrefix="mobile" 
    Namespace="System.Web.UI.MobileControls" 
    Assembly="System.Web.Mobile" 
%>
<script runat="server" language="VB">
</script>
<mobile:form 
    id="StartForm" 
    runat="server">
    <mobile:label 
        runat="server" 
        id="lbl1"
        text="First Label" 
        forecolor="Red"
        alignment="right"
        font-name="Arial"
        font-bold="True"
    />
</mobile:form>



Mobile label: foreground color and wrap (VB.net)

<%@ Page 
    Inherits="System.Web.UI.MobileControls.MobilePage" 
    Language="VB" 
%>
<%@ Register 
    TagPrefix="mobile" 
    Namespace="System.Web.UI.MobileControls" 
    Assembly="System.Web.Mobile" 
%>
<script runat="server" language="VB">
</script>
<mobile:form 
    id="StartForm" 
    runat="server">
    <mobile:label 
        runat="server" 
        id="lbl2"
        text="This text will scroll off the screen." 
        forecolor="Green"
        alignment="Left"
        font-name="Times New Roman"
        font-italic="true"
        wrapping="NoWrap"
    />
</mobile:form>



Mobile label visibility (VB.net)

<%@ Page 
    Inherits="System.Web.UI.MobileControls.MobilePage" 
    Language="VB" 
%>
<%@ Register 
    TagPrefix="mobile" 
    Namespace="System.Web.UI.MobileControls" 
    Assembly="System.Web.Mobile" 
%>
<script runat="server" language="VB">
</script>
<mobile:form 
    id="StartForm" 
    runat="server">
    <mobile:label 
        runat="server" 
        id="lbl3"
        text="This text will not be seen." 
        visible="false"
    />
</mobile:form>



Set text to mobile label (VB.net)

<%@ Page 
    Inherits="System.Web.UI.MobileControls.MobilePage" 
    Language="VB" 
%>
<%@ Register 
    TagPrefix="mobile" 
    Namespace="System.Web.UI.MobileControls" 
    Assembly="System.Web.Mobile" 
%>
<script runat="server" language="VB">
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
    Dim MyMobCaps as Mobile.MobileCapabilities
    MyMobCaps = Request.Browser
    Label1.Text = "Your browser name is: " _
        & MyMobCaps.Browser
End Sub
</script>
<mobile:Form id="Test" runat="server">
    <mobile:label
        runat="server" 
        id="Label1"
    />
</mobile:Form>