0

私はこれを機能させるための構文を探してネットをトロールしました。これが迅速な修正であると期待しています。基本的に私はネストされたリピーターを持っており、下のボタンは別のネストされたリピーターを非表示にします。

((location_details)((RepeaterItem)Container.Parent.Parent).DataItem).tbl_location.location_id完全にうまく評価されますが(私がテストしている場合は3824)、javascript関数の文字列パラメーターになるように渡そうとすると、毎回失敗します。

<asp:Linkbutton ID="lb_showhide_oloc_gnotes" runat="server" Text="Expand/Close" 
 href='javascript:sltoggle('" + <%# ((location_details)((RepeaterItem)Container.Parent.Parent).DataItem).tbl_location.location_id %> +" '); return false;' />

私が見逃しているアイデア(上記の構文が間違っていることはわかっていますが、すでに100回変更している必要がありますが、アイデアは得られます)。

ありがとう!

4

2 に答える 2

0

現在これをテストできないため、これは間違っている可能性がありますが、の値を連結する必要はありませんhref

<asp:Linkbutton ID="lb_showhide_oloc_gnotes" runat="server" Text="Expand/Close" 
 href='javascript:sltoggle("<%# ((location_details)((RepeaterItem)Container.Parent.Parent).DataItem).tbl_location.location_id %>"); return false;' />
于 2012-07-03T20:59:29.550 に答える
0

あなたは試しましたasp:HyperLinkNavigateUrlasp:LinkButtonアンカータグにレンダリングされ、その属性はASPによって生成される必要があるため(ポストバックが発生しますhref)、それがバインドされない理由です。

于 2012-07-03T21:59:08.340 に答える