如何在asp.net頁面中顯示覆雜數據對象?實際上,下面的類是隻讀的,數據需要顯示在屏幕上,以便代理商可以告訴客戶他們需要付多少錢。我不想寫很多代碼來規範化並在頁面上顯示它。該數據通過Web服務方法調用返回。如何快速在asp.net頁面上顯示覆雜數據
public class FeeInfo {
private string countryInfoTextField;
public string CountryInfoTextField
{
get{return this.countryInfoTextField;}
set{this.countryInfoTextField= value;}
}
private stringfeeInfoTextField;
public string FeeInfoTextField
{
get{return this.feeInfoTextField;}
set{this.feeInfoTextField= value;}
}
private string taxInfoTextField;
public string TaxInfoTextField
{
get{return this.taxInfoTextField;}
set{this.taxInfoTextField = value;}
}
private string additionalInfoTextField;
public string additionalInfoText
{
get{return this.additionalInfoTextField;}
set{this.additionalInfoTextField = value;}
}
private PromotionInfo[] promotionInfoField; //Class
private SendAmountInfo sendAmountsField; //Class
private EstimatedReceiveAmountInfo receiveAmountsField; //Class
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("promotionInfo")]
public PromotionInfo[] promotionInfo {
get {
return this.promotionInfoField;
}
set {
this.promotionInfoField = value;
}
}
/// <remarks/>
public SendAmountInfo sendAmounts {
get {
return this.sendAmountsField;
}
set {
this.sendAmountsField = value;
}
}
/// <remarks/>
public EstimatedReceiveAmountInfo receiveAmounts {
get {
return this.receiveAmountsField;
}
set {
this.receiveAmountsField = value;
}
}
}
我轉換到上述列表,並將其綁定到gridview的,但所有我看到的是4個字段,而不是最後3層複合物的性質。在屏幕上顯示這些數據的快捷方式是什麼?
最後三個私人variables.They're不去類的外部被曝光。 –
@AmitKumarGhosh這些變量也有3個公共屬性,就像其他變量一樣。對不起,我在這裏粘貼代碼時錯過了。只更新了代碼。 – Hitin