Hi rajus,
Check this example. Now please take its reference and correct your code.
HTML
WebUserControl.ascx
Name:
<asp:Label ID="lblName" runat="server" />
Default.aspx
<%@ Register Src="~/WebUserControl.ascx" TagName="ucName" TagPrefix="uc" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtName" runat="server" />
<asp:Button Text="Submit" runat="server" OnClick="Submit" />
<uc:ucName ID="ucName" runat="server"></uc:ucName>
</div>
</form>
</body>
</html>
Code
WebUserControl.ascx.cs
public string Name
{
get
{
return lblName.Text;
}
set
{
lblName.Text = value;
}
}
WebUserControl.ascx.vb
Public Property Name As String
Get
Return lblName.Text
End Get
Set(ByVal value As String)
lblName.Text = value
End Set
End Property
Default.aspx.cs
protected void Submit(object sender, EventArgs e)
{
ucName.Name = txtName.Text;
}
Default.aspx.vb
Protected Sub Submit(ByVal sender As Object, ByVal e As EventArgs)
ucName.Name = txtName.Text
End Sub
Screenshot