Ho provato, ma senza tabContainer:
Pagina ASPX
codice:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="usercontrols_Default" %>
<%@ Register Src="uc.ascx" TagName="uc" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Try</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager runat="server" ID="sm" />
<asp: DropDownList ID="ddl" runat="server" AutoPostBack="true">
<asp:ListItem>
Uno
</asp:ListItem>
<asp:ListItem>
Due
</asp:ListItem>
<asp:ListItem>
Tre
</asp:ListItem>
</asp: DropDownList>
<uc1:uc ID="UCLabel" runat="server" />
</div>
</form>
</body>
</html>
>> Codice VB della pagina:
Partial Class usercontrols_Default
Inherits System.Web.UI.Page
Protected Sub ddl_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddl.SelectedIndexChanged
UCLabel.valore_label = ddl.SelectedItem.Text
End Sub
End Class
UserControl:
codice:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="uc.ascx.vb" Inherits="usercontrols_uc" %>
Label:
<asp:Label ID="lb" runat="server"></asp:Label>
>> Codice VB dello UserControl:
Partial Class usercontrols_uc
Inherits System.Web.UI.UserControl
Public Property valore_label() As String
Get
Return Me.lb.Text
End Get
Set(ByVal value As String)
lb.Text = value
End Set
End Property
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' .......
End Sub
End Class
Funziona....a meno che io non abbia capito la problematica..