2
주소 사용자 컨트롤이 있습니다.사용자 정의 간단한 데이터 바인딩 - ASP.NET
<fieldset>
<legend><%#Title%></legend>
<div>
<div>Country</div>
<div><uc:TextBox ID="txtCountry" runat="server" /></div>
</div>
<div>
<div>City</div>
<div><uc:TextBox ID="txtCity" runat="server" /></div>
</div>
<div>
<div>Street</div>
<div><uc:TextBox ID="txtStreet" runat="server"/></div>
</div>
</fieldset>
그리고
private BEAddress _address;
public BEAddress Address
{
get
{
if (CoordinatesVisible)
{
_address = new BEAddress()
{
Country = txtCountry.Text,
City = txtCity.Text,
Street = txtStreet.Text,
Block = txtBlock.Text,
Building = txtBuilding.Text,
Latitude = txtLatitude.Text,
Longitude = txtLongitude.Text
};
}
else
{
_address = new BEAddress()
{
Country = txtCountry.Text,
City = txtCity.Text,
Street = txtStreet.Text,
Block = txtBlock.Text,
Building = txtBuilding.Text
};
}
return _address;
}
set
{
if (CoordinatesVisible)
{
_address = new BEAddress()
{
Country = value.Country,
City = value.City,
Street = value.Street,
Block = value.Block,
Building = value.Building,
Latitude = value.Latitude,
Longitude = value.Longitude
};
}
else
{
_address = new BEAddress()
{
Country = value.Country,
City = value.City,
Street = value.Street,
Block = value.Block,
Building = value.Building,
Latitude = value.Latitude,
Longitude = value.Longitude
};
}
}
}
어떻게 간단한 데이터 바인딩해야합니까 숨김
? 난 당신이 내가 전혀 좋아하지 않는 DetailsView 마녀를 사용하려는 경우가 아니면 아무것도 ASP.NET에서 상자 밖으로 없다이<uc:Address runat="server" ID="uc1" Address=<%#GetAddress %> />