English 中文(简体)
• 如何在电网测量中检查或检查che箱
原标题:How to make checbox checked or uncheked in gridview editmode

i) 做了许多栏目和胎面的电网测量,有些是文字,下游名单正在完善。

如何将价值分配到一个检查箱,使之检查或不受检查?

想要达到的价值是......。

So i am having trouble doing this.

My Gridview: 只是其过于庞大。

<asp:TemplateField HeaderText="CA. 更新">
    <ItemTemplate >
         <asp:Label ID="Label6" runat="server" Text= <%# Eval("CA. 更新") %>  ></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
         <asp:TextBox runat="server" ID="txtCupdate" Text= <%# Eval("CA. 更新") %>  ></asp:TextBox>
    </EditItemTemplate>
</asp:TemplateField>

<asp:TemplateField HeaderText="Email">
    <ItemTemplate >
        <asp:Label ID="Label6" runat="server" Text= <%# Eval("Email") %>  ></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:CheckBoxList ID="checkEmail"  runat="server">
            <%--HOW TO MAKE THIS CHECKED OR UNCHECKED ? when i have values Yes / NO--%>

        </asp:CheckBoxList>
     </EditItemTemplate>
</asp:TemplateField>

A. 更新

1. 如果将上述规定视为:

 <EditItemTemplate>
        <asp:CheckBoxList ID="checkEmail" selectedvalue= <%# Eval("Email") %>   runat="server">
            <asp:ListItem Value="Yes">Yes</asp:ListItem>

        </asp:CheckBoxList>
     </EditItemTemplate>

在该案中,当我们知道时,我确实检查了箱子,但是,如果是诺言,它就赢得了可能的错误,因为在che箱子中,没有价值诺言可以选择。 任何解决办法。

谢谢。

最佳回答

检查局(BoxList)需要具备所有可支配的价值。

<asp:CheckBoxList ID="checkEmail" selectedvalue= <%# Eval("Email") %>   runat="server">
    <asp:ListItem Value="Yes">Yes</asp:ListItem>
    <asp:ListItem Value="No">No</asp:ListItem>
</asp:CheckBoxList>

虽然我不理解为什么你想要使用一种检查BoxList而不是像这样的一个检查箱。

<asp:CheckBox runat="server" ID="checkEmail" Checked =  <%# Eval("Email").ToString().Equals("yes", StringComparison.OrdinalIgnoreCase) %>  />
问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签