asp.net - How to take Button Id When i create buttons using the dynamic Buttons -


i have written code , assigned name , text that.

but want button id when create. how it?

panel1.controls.clear(); string btn_name = textbox1.text; button add_btn = new button(); add_btn.name = btn_name; add_btn.text = btn_name; add_btn.click += new eventhandler(this.btn_method); add_btn.size = new system.drawing.size(100, 25); add_btn.location = new system.drawing.point(10, button_count * 150); add_btn.font = new font("times new roman", 10); add_btn.backcolor = color.silver; add_btn.forecolor = color.black;  panel1.controls.add(add_btn); button_count++;     


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -