1.前台**:
"view codeorderlist
" runat="
server
"onitemdatabound="
orderlist_itemdatabound
">
class="
item
">
class="
table
" style="
border:1px solid #ddcccc;; border-right:none;
" cellspacing="
0" cellpadding="
0">"2
" colspan="
5">
發貨單號:"3
">"8
">
訂單號:"4
">
ordercode
")%>"3
">
ordertime
")%>
收貨人:
consignee
")%>"6
" style="
text-align:left;
">
address
")%>"8
" style="
text-align:left
">
mobile
")%>"9
"> 序號"
5">農品描述
單價數量金額"
server
" id="
detailorder
">
rowid
")%>"5
"class="
tr" style="
text-align:left
">
name
")%>
unitprice
")%>
count
")%>
totalprice
")%>
class="
dd">配送費:
express
")%>
class="
dd">**折扣:"2
"class="
dd">
perferprice
")%>
class="
dd">訂單金額:
amount
")%>
class="
dd" style="
">遊遊卡支付:
ka")%>
已付款:
resultamount
")%>
應付款:"6
" style="
text-align:left;
">
resultamount
")%>
2.後台**:
protectedview codevoid page_load(object
sender, eventargs e)
, stringsplitoptions.removeemptyentries);
string newids = string.join(","
, array);
initdata(newids);}}
public
void initdata(string
newids)
",c.amount), //
金額 perferprice ="
未打折" ,//
打折 express =c.express==0?"
0.00
":string.format("
",c.express),
resultamount =string.format("
",convert.todouble(c.amount) -convert.todouble(c.subprice) +convert.todouble(c.express)),
yingamount=c.status==0?string.format("
",convert.todouble(c.amount) -convert.todouble(c.subprice) + convert.todouble(c.express)):"
0.00",
ka="
0.00
"}).tolist();
orderlist.datasource =_list;
orderlist.databind();
}protected
void orderlist_itemdatabound(object
sender, repeateritemeventargs e)
).tolist();
rep.datasource =_list;
rep.databind();}}
3.說明:
因為資料是model型別的所以在
ordernode rowv = (ordernode)e.item.dataitem;//是轉成model型別,若是資料是table型別,那麼在此就應該是找到分類repeater關聯的資料項
datarowview rowv = (datarowview)e.item.dataitem;//找到分類repeater關聯的資料項
Repeater 控制項巢狀使用
概述 在專案中做許可權的時候使用到了repeater的巢狀 像for迴圈巢狀 如圖 這裡的功能頁面和功能許可權都是通過repeater遍歷出來的,表示的是乙個功能頁面中包含多個功能許可權,是個一對多的關係。具體的許可權設計這裡不說明,主要是說如何進行repeater巢狀的。具體步驟如下 第一步 定義...
Repeater巢狀控制項
在我們編寫程式的時候經常會遇到控制項巢狀的問題。通常最經常用到的控制項時repeater,以下是一兩個列子。html databinder.eval container,dataitem.au id 大類 databinder.eval container,dataitem.title id 小類 ...
Repeater資料控制項的巢狀
inherits usercontrols uccategories tagprefix uc1 商品類別 runat server selectcommand select categoryid categoryname from categories where parentcategoryid...