anjumathi kumar

anjumathi kumar

  • NA
  • 54
  • 64.2k

How to add onclick function to the dynamic Button

Aug 3 2011 2:25 AM
Hi how to add onclick function to the dynamic button

I wrote like this

for loop
{
  ImageButton btn = new ImageButton();
  btn.ID = "btn" + i;
  btn.ImageUrl = "images/edit.jpg";
  //btn.OnClientClick += new EventHandler(get);
  btn.Attributes.Add("onclick", "get()");
}

<pre lang="cs">public void get(object sender, EventArgs e)
  {
  this.mopopupeditrule.Show();
  }</pre>
in this onclick function not works..how can i give...if i click button one modalpopup want to show..any idea?

Answers (6)