473,385 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

add event handler to butoon dynamicly

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
1 1188
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
8
by: frankcvc | last post by:
I created a control array at runtime using the following code. I also wanted to code the controlarray click event. My code can respond to click event but cannot identify the specific control...
0
by: Emrah Gozcu | last post by:
I have a custom control tabstrib and it loads another custom control when clicked a tab. Tabstrib event fires well but the other custom control which is dynamicly loaded after clicking a tab,...
0
by: Emrah Gozcu | last post by:
I have a custom control tabstrib and it loads another custom control when clicked a tab. Tabstrib event fires well but the other custom control which is dynamicly loaded after clicking a tab,...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
1
by: Henke | last post by:
Hi I have a aspx-page with a panel-control. On this panel control I add user controls dynamicly with LoadControl and panel.Controls.Add(myControl). On some of the dynamicly added user controls I...
6
by: pronerd | last post by:
Hi, I am trying to dynamically set an event handler across frames. I have no problems setting properties across frames doing something like parent.ToolMenuFrame.location.href =...
6
by: Class | last post by:
Hi all, I create a gridview dynamicly because I don't know the columns in advance. I use the Templatefield to create a linkbutton. Everything fine..I have the postbackurl and it works. But now...
2
by: kranthi4uonly | last post by:
how to select all items in list box by butoon click in c# can any one give the smaple code for this
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.