需要帮助直放站 [英] Need help with repeater

查看:123
本文介绍了需要帮助直放站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的转发器:

<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取代..
即当用户点击设为默认值链接,就应改为是的标签

What I want is that when user clicks on any of the "lnk1" link button in the list that repeater renders, the link should be replaced with the label "label1".. i.e. when the user clicks on "Make Default" link, it should be replaced with "Yes" label

调用此方法 obj.SetDefaultAddress(); 是设置在DB的默认地址好吗..
问题是与LABEL1的显示和lnk1当中继呈现...

Calling this method obj.SetDefaultAddress(); is setting the default address in the DB alright.. problem is with the display of the label1 and lnk1 when the repeater renders...

正在发生的事情是,无论设为默认值的LinkBut​​ton和YES的标签也越来越显示
下表中的我直放站里面的默认列中。

what is happening is that BOTH "Make Default" LinkButton and the "YES" label are getting displayed under the "Default" column of the table inside my repeater.

我要一些code,将在我的数据库中勾选ISDEFAULT值,并显示设为默认链接按钮

I want some code that will check the "IsDefault" value in my DB and display "Make Default " link button

和YES的标签相应......也就是说,如果ISDEFAULT的在DB值为TRUE,那么YES应显示在中继
否则设为默认

and "YES" label accordingly... i.e. if IsDefault's value in the DB is TRUE then "YES" should be displayed in the repeater otherwise "Make Default"

推荐答案

您确定ItemCommand下code code你的作品背后正在执行?
我只是改变了CommandName的从SetDefault到SetDefaultAddress在aspx文件与一个在code匹配的背后,它的工作。

Are you sure your piece of code in code behind under ItemCommand is executing? I only changed the CommandName from SetDefault to SetDefaultAddress in aspx file to match with the one in code behind, it worked.

这篇关于需要帮助直放站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆