I have following code snippet at page load event. protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Button1.Attributes.Add("onclick", "alert('hello')"); Button2.Click += new EventHandler(Button2_Click); } } button1 display the alert message when we click on that. But when i click on button2, it doesn't fire Button2_Click event. Why? Althouh if i comment "if (!IsPostBack)" line, the code working fine.
________________________________
Posted on behalf of Gehlot.arvind
Best regards,
Webmaster
http://www.dotnetfunda.com