Header user component (VB.net) : Header « User Control and Master Page « ASP.Net

Home
ASP.Net
1.ADO.net Database
2.Ajax
3.Asp Control
4.Collections
5.Components
6.Data Binding
7.Development
8.File Directory
9.HTML Control
10.Language Basics
11.Login Security
12.Mobile Control
13.Network
14.Page
15.Request
16.Response
17.Server
18.Session Cookie
19.Sitemap
20.Theme Style
21.User Control and Master Page
22.Validation by Control
23.Validation by Function
24.WebPart
25.WPF
26.XML
ASP.Net » User Control and Master Page » Header 
Header user component (VB.net)

<%@ Page Language="vb" %>
<%@ Register TagPrefix="MyTag" TagName="Header" Src="header.ascx" %>

<html>
<head>
  <title>User Control Examples</title>
</head>

<body>
    <form runat="server" method="post">
        <MyTag:Header id="MyHeader" runat="Server" />
        <h3>The Multi-Lingual Control Example </h3>
    </form>
</body>
</html>

<%-- header.ascx
<%@ Control Language="vb" %>

<table style="background-color:#cc0033" width="100%" cellpadding="10" cellspacing="0">
    <tr>
        <td width="60%"> <font face="verdana,arial" size="4" color="yellow">
            <asp:label id="WelcomeMessage" runat="Server">Welcome to the shop!</asp:label> </font>
        </td>
        <td width="30%">
            <font face="verdana,arial" size="2" color="lightyellow"> Select your Language:<br />
            <asp:DropDownList id="LanguageList" runat="Server" OnSelectedIndexChanged="DropList_Changed" AutoPostBack="True"/>
            </font>
        </td>
    </tr>
</table>

<script runat="server">
    
    Private Languages As New Hashtable()
    
    Public Sub Page_Load()
    
     Languages.Add("English""Hello, and welcome to the shop")
     Languages.Add("French""Bonjour, et bienvenue au magasin")
     Languages.Add("Spanish""Buenas Dias, e bienvenido a la tienda")
     Languages.Add("German""Guten Tag, und wilkommen ins geschaeft")
    
     If Not Page.IsPostback
    
       LanguageList.Datasource = Languages.Keys
       Page.DataBind()
    
     End If
    
    End Sub
    
    Public Sub DropList_Changed(Sender As Object, E As EventArgs)
    
      WelcomeMessage.text = Languages(Languagelist.SelectedItem.Text)
      
    End Sub
    
</script>

--%>
           
       
Related examples in the same category
1.User control for page header
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.