本文介绍了为LinkBut​​ton定义命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正试图将LinkBut​​ton控件添加到网络表单中。我这样做的事情就像:b / b
for(i = 1; i< = someVariable; i ++)

{

LinkBut​​ton PageLink = new LinkBut​​ton();

PageLink.CommandName = i.ToString();

PageLink.Text =" Page" + i;


PageLink.Command + = PageLink_Click;

}

问题在于最后一道。我正在尝试做的是指定

当LinkBut​​ton被点击时,后面的代码中需要调用什么方法。但它在编译时会产生错误。

请帮助,

谢谢

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

推荐答案







这篇关于为LinkBut​​ton定义命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 09:36