How to get the Client side generated button into Code behind?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • varunkumarid
    New Member
    • Aug 2008
    • 40

    #1

    How to get the Client side generated button into Code behind?

    Hi to All, I have created the button in client side. When the user going to click the button how can i get the event in code behind?

    Here is my javascript code.

    Code:
                      
    
     function CreateDeleteButton() {
         debugger;
         var Delete = document.getElementById('ctl00_cphMaster_tdbtnSave');
         var btnDelete = document.createElement("BUTTON");
         Delete = Delete.appendChild(btnDelete);
         var buttext = document.createTextNode('Delete');
         btnDelete.appendChild(buttext);
         if (btnDelete.onclick = saveEdit) {
             __doPostBack('btnDelete', 'btnDelete_Click');          
         }
     }
     function saveEdit() {
         var ye = confirm("Are You Sure to Delete this Data");
         if (!ye) {
             return false;
         }
     }
    Please give me the solution to solve my problem.

    Thanks to all.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    If the button calls a postback, it should show up in the Request object

    Comment

    Working...