开发者

How to pass query in a dynamically created linkbutton in asp.net

开发者 https://www.devze.com 2023-01-08 13:26 出处:网络
I wanna to pass query in a dynamic link button. I can add it dynamically but unable to pass query on that. Apart from that LinkButton_onClick handler is not working.

I wanna to pass query in a dynamic link button. I can add it dynamically but unable to pass query on that. Apart from that LinkButton_onClick handler is not working.

Pls tell me how to proe开发者_高级运维ed?


Have you assigned the event to the button?

LinkButton myNewButton = new LinkButton();
myNewButton.Text = "Click me!";
myNewButton.Click += new EventHandler(this.myNewButton_Click);

protected void myNewButton_Click() {
    //do stuff here
}

If you've already done this, chances are you're creating the control in the wrong Page Event.

0

精彩评论

暂无评论...
验证码 换一张
取 消