How to using DeepLoad in netTiers?

In my current project, we are using CodeSmith + netTiers as framework. It is a great framework for rapid development.

Today I will explain how to use DeepLoad features in netTiers.

We have two tables, one is PortalReports, it contains a foreign key call ReportTypeId to the other table call PortalReportTypes.  In PortalReportTypes we have a column call ReportTypeName. What we want is in GridView, we need to show ReportTypeName rather than  ReportTypeId. I think it is a very common requirement. So how can be done using the DeepLoad features in netTiers framework and not write any code?  

< asp:GridView ID = " gvReport "  HeaderStyle - CssClass = " gridheader "  AllowSorting = " true "  DataKeyNames = " ReportId "  DataSourceID = " dsReport "  OnRowCommand = " gvReport_RowCommand "
AllowPaging
= " true "  runat = " server "  AutoGenerateColumns = " false "  Width = " 500px " >
  
< Columns >
    
< asp:TemplateField >
      
< HeaderTemplate > Report Type </ HeaderTemplate >
      
< ItemTemplate ><% #Eval( " ReportTypeIdSource.ReportName " ) %></ ItemTemplate >
    
</ asp:TemplateField >
  
</ Columns >
</ asp:GridView >
< data:PortalReportsDataSource ID = " dsReport "  runat = " server "  EnablePaging = " True "  EnableSorting = " True "  EnableTransaction = " False "  SelectMethod = " GetPaged "  EnableDeepLoad = " true " >
    
< DeepLoadProperties Method = " IncludeChildren "  Recursive = " false " >
        
< Types >
            
< data:PortalReportsProperty Name = " PortalReportTypes "   />
        
</ Types >
    
</ DeepLoadProperties >
</ data:PortalReportsDataSource >

The import things here are
1. EnableDeepLoad="true"
2. <%#Eval("ReportTypeIdSource.ReportName")%> should be foreignkey+"Source".PropertyName

转载于:https://www.cnblogs.com/winsonweb/archive/2008/11/28/1343173.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值