幫助這是我轉發:需要與中繼
<asp:Repeater ID="myRepeater" OnItemCommand="myRepeater_ItemCommand" runat="server" OnItemDataBound="myRepeater_OnItemDataBound">
<HeaderTemplate>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
<tr class="lgrey">
<td>Default</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<table>
<tr>
<td>
<asp:LinkButton ID="lnk1" Text="Make Default" CommandName="SetDefault" runat="server" Visible="True" CommandArgument='<%#Eval("UserID") %>' CausesValidation="false"></asp:LinkButton>
<asp:Label ID="label1" Text="Yes" runat="server" Visible="False"></asp:Label>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
我要的是,當用戶點擊任何 在中繼呈現列表中的「lnk1」鏈接按鈕, 鏈接應更換與標籤「LABEL1」 .. 即當用戶點擊「設爲默認值」鏈接,應使用「是」標籤
調用此方法obj.SetDefaultAddress();
是好的設置在DB的默認地址.. 取代問題是顯示label1和lnk1的時候中繼器呈現...
發生了什麼是兩個「默認」LinkButton和「是」標籤顯示 在我的中繼器內的表的「默認」列下。
我想一些代碼,將在我的數據庫查詢「ISDEFAULT」值,並顯示「設爲默認」鏈接按鈕
和「YES」的標籤據此......也就是說,如果ISDEFAULT的在DB值爲TRUE則應該在中繼器中顯示「是」 否則「設爲默認值」
我糾正了......我輸入錯誤...命令名稱匹配..它將地址設置爲默認在DB! – Serenity 2010-11-24 04:58:41
在您編輯的代碼中,您正在使用obj.IsDefault,您是否試圖在調試模式下檢查其值? – Waqas 2010-11-24 05:03:16
調試器只顯示IsDefault的值爲false,這顯然就是爲什麼「Make Default」鏈接顯示在中繼器內的原因。下面的回答者說,probelm與Selected Index。我如何解決這個問題? Plz help..thnx – Serenity 2010-11-24 05:11:56