add event handler to butoon dynamicly

G

Guest

Hi I add butoon dynamidly to page but I have to double clock ob button until it work I set auto post back =true for butoon that if i click just one time on it it run the void but still I have to click button twic

//new Ro
TableRow r2 = new TableRow()
TableCell c20 = new TableCell()
c20.ColumnSpan=7
c20.CssClass="content"
c20.VerticalAlign=VerticalAlign.Middle
c20.HorizontalAlign=HorizontalAlign.Right
c20.Height=25


Button Btn_CA=new Button()
Btn_CA.Attributes.Add("AutoPostBack","true")
Btn_CA.Click += new System.EventHandler(this.FormData_Changed)
Btn_CA.Text="Calculate"
Btn_CA.ToolTip="Click Here To Calculate Items"
c20.Controls.Add(Btn_CA)
 
V

Victor Garcia Aprea [MVP]

Please see my reply in the buildingcontrols group,

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup

mahsa said:
Hi I add butoon dynamidly to page but I have to double clock ob button
until it work I set auto post back =true for butoon that if i click just one
time on it it run the void but still I have to click button twice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top