English 中文(简体)
GridView.FindControl()——工作,但并不恰当
原标题:GridView.FindControl() - works, but not properly

我的《意见》一栏认为:

         <Columns>
            <asp:TemplateField HeaderText="Opcje">
                <ItemTemplate>
                    <asp:LinkButton runat="server" Text="Accept" ID="AcceptBtn" CommandName="Accept"/>
                    <asp:LinkButton runat="server" Text="Deny" ID="DenyBtn" CommandName="Deny"/> 
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>

在修建新牢房的同时,我想改变“联系邦”的指挥财产:

    protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {
        ((LinkButton)e.Row.FindControl("AcceptBtn")).CommandArgument = myFiles[fileIndex].Name;
        ((LinkButton)e.Row.FindControl("DenyBtn")).CommandArgument = myFiles[fileIndex].Name;
    }

问题在于,在我点击接受Btn时,该法似乎并未改变任何内容。

    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Accept")
        {
            string ss = (string)e.CommandArgument;
            ...
        }
    }

<>s = “”。 为什么? 如果该网页被张贴在邮局,那么两个指挥区都被清除了吗?

最佳回答

http://www.ohchr.org。

问题回答

你们需要像使用有增长数据的活动。

 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        ((LinkButton)e.Row.FindControl("AcceptBtn")).CommandArgument = myFiles[fileIndex].Name;
        ((LinkButton)e.Row.FindControl("DenyBtn")).CommandArgument = myFiles[fileIndex].Name;
    }
}

页: 1

myFiles[fileIndex].Name;

每一组成部分?





相关问题
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!

热门标签