c# - How can I add a click event to my div from code behind? -


How do I add a click event from my device behind the code?

To congratulate a box with a box, do you want to delete it and yes or not in the box?

All of the following codes:

  while (Reader. ()) {System.Web.UI.HtmlControls.HtmlGenericControl div = New system. Web.UI.HtmlControls.HtmlGenericControl ("div"); Div.Attributes ["class"] = "test"; //div.Style["float "] =" left "; Div.ID = "test"; Image IMG = new image (); Img.ImageUrl = String.Format ("{0}", reader.getstring (1)); // this line to SQL syntax // img Need to represent in iJurl = "~ / UserData / 2 / UploadMag / Batman-for-Facebook.JPG"; Img.AlternateText = "Test Image"; Div.Controls.Add (img); Div.Controls.Add (ParseControl (String.Format ("& amp; nbsp;" + "{0}", Reader. GetString (0))); Div.Style ["Clear"] = "Both"; Test1.Controls.Add (div); }   

Can you add one click event for it, if so?

This link should be used:

  c # _mybutton .Attributes.Add ("onclick", "return confirm_delete ();"); Javascript: function confirm_delete () {If (Confirm ("Are you sure to delete custom search?") == true) Back to true; Second false return; }    

Comments