Add control to mobile panel in code (VB.net) : Panel « Mobile Control « ASP.Net






Add control to mobile panel in code (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 MyLabel = New System.Web.UI.MobileControls.Label
    Dim MyTB = New System.Web.UI.MobileControls.TextBox
    MyLabel.ID = "lbl1"
    MyLabel.Text = "The first label."
    Pan1.Controls.Add(MyLabel)
    MyTB.ID = "txt1"
    MyTB.Text = "Enter some text!"
    Pan1.Controls.Add(MyTB)    
End Sub
</script>

<mobile:form 
    id="FirstPage" 
    runat="server">
<mobile:panel
    id="Pan1"
    runat="server"
/>
</mobile:form>

           
       








Related examples in the same category

1.Add mobile label to mobile panel (VB.net)