问题描述
我正试图将LinkButton控件添加到网络表单中。我这样做的事情就像:b / b
for(i = 1; i< = someVariable; i ++)
{
LinkButton PageLink = new LinkButton();
PageLink.CommandName = i.ToString();
PageLink.Text =" Page" + i;
PageLink.Command + = PageLink_Click;
}
问题在于最后一道。我正在尝试做的是指定
当LinkButton被点击时,后面的代码中需要调用什么方法。但它在编译时会产生错误。
请帮助,
谢谢
Hi,
I''m trying to dinamically add LinkButton Controls to a web form. I do
something like:
for(i=1;i<=someVariable;i++)
{
LinkButton PageLink = new LinkButton();
PageLink.CommandName = i.ToString();
PageLink.Text = "Page " + i;
PageLink.Command += PageLink_Click;
}
The problem is with the last lane. What I''m trying to do there is to specify
what methon in the code behind needs to called when the LinkButton is
clicked. But it generates an error at compilation.
Please Help,
Thank you
推荐答案
这篇关于为LinkButton定义命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!