run time event create
-
i try this code but this not worked properly. Button but = new Button(); but.Text = "Full Detail"; but.ID = "Full_Detail"; t.OnClientClick += new System.EventHandler(fullDetail); Panel1.Controls.Add(but); private void fullDetail(object sender, EventArgs e) { SearchResult.InnerHtml = "Hi"; }
-
i try this code but this not worked properly. Button but = new Button(); but.Text = "Full Detail"; but.ID = "Full_Detail"; t.OnClientClick += new System.EventHandler(fullDetail); Panel1.Controls.Add(but); private void fullDetail(object sender, EventArgs e) { SearchResult.InnerHtml = "Hi"; }
Your click event will not fire unless the button is added before the page load event.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
i try this code but this not worked properly. Button but = new Button(); but.Text = "Full Detail"; but.ID = "Full_Detail"; t.OnClientClick += new System.EventHandler(fullDetail); Panel1.Controls.Add(but); private void fullDetail(object sender, EventArgs e) { SearchResult.InnerHtml = "Hi"; }
when did you add the button. check this, itw working fine
protected void Page_Load(object sender, EventArgs e) { Button b = new Button(); b.Text = "Dunamic"; b.ID = "myid"; b.Click += new EventHandler(b_Click); Panel1.Controls.Add(b); } void b_Click(object sender, EventArgs e) { Response.Write("Dynamic Button"); }
Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"
-
when did you add the button. check this, itw working fine
protected void Page_Load(object sender, EventArgs e) { Button b = new Button(); b.Text = "Dunamic"; b.ID = "myid"; b.Click += new EventHandler(b_Click); Panel1.Controls.Add(b); } void b_Click(object sender, EventArgs e) { Response.Write("Dynamic Button"); }
Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"
thank this code button load in page_load but i have a button. then click on button i want to create a new button and then i click on new button than show message "Hi";
-
thank this code button load in page_load but i have a button. then click on button i want to create a new button and then i click on new button than show message "Hi";
prakash_adysoft wrote:
this code button load in page_load
yes
prakash_adysoft wrote:
have a button. then click on button i want to create a new button
as Chirs say, you have register event before page load.
Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"
-
when did you add the button. check this, itw working fine
protected void Page_Load(object sender, EventArgs e) { Button b = new Button(); b.Text = "Dunamic"; b.ID = "myid"; b.Click += new EventHandler(b_Click); Panel1.Controls.Add(b); } void b_Click(object sender, EventArgs e) { Response.Write("Dynamic Button"); }
Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"
I think its better to creat to do this functionality in Page_init rather than Page Load
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
I think its better to creat to do this functionality in Page_init rather than Page Load
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
yes.
Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"