By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,686 Members | 1,603 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,686 IT Pros & Developers. It's quick & easy.

add event handler to butoon dynamicly

P: n/a
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)

Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <an*******@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.com...
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
//new Row
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);

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.