This is a migrated thread and some comments may be shown as answers.

[Solved] Rad Confirm

3 Answers 159 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ahmet Ozkan
Top achievements
Rank 1
Ahmet Ozkan asked on 24 Dec 2009, 07:50 AM
I tried to get a linkbutton's clientID which is inside an asp:datagrid not "radgrid" with below script and I set linkbutton's  onclientclick attribute at on itemdatabound, when I click linkbutton inside the datagrid confirmation well shown, but when clicking OK; result is nothing, what is the problem actually, I really want to understand how rad confirm work.

function setButtonClientID(clientID, text, title) 
                {
                    btnName = clientID;
                    radconfirm(text, ClientCallback, 480, 180, '', title); 
                }
                    
                var ClientCallback = function (arg)  
                {
                    //alert('btnName: ' + btnName + ' arg: ' + arg); 
                    if (arg) 
                    {
                        __doPostBack(document.getElementById(btnName).id, 'Recover');
                        //document.getElementById(btnName).click();
                       
                    }
                }

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Dec 2009, 08:41 AM
Hello Ahmet,

I tried your code and it is working fine in my end. I am not sure about what is happening in your case. But can you try attaching the onclick event in the ItemCreated event instead of ItemDataBound? Also make sure that you canceled the postback by adding return false when attaching onclick to LinkButton.

-Shinu.
0
Ahmet Ozkan
Top achievements
Rank 1
answered on 24 Dec 2009, 09:14 AM
I tried itemcreated but no change, but I cannot understand that; how linkbutton's onclick event canceled with return false.
0
Svetlina Anati
Telerik team
answered on 24 Dec 2009, 10:51 AM
Hi Ahmet Ozkan,

I already answered your other thread and for your convenience I pasted my reply below:

I examined your code and as far as I can see the problem coes from the manner you have called the __doPostBack method - you should call it with the UniqueID of the control as explained below:

http://geekswithblogs.net/mnf/archive/2005/11/04/59081.aspx

This being said your code should look similar to teh following one:

function setButtonClientID(clientID, text, title)  
               
                   btnName = clientID; 
                   radconfirm(text, ClientCallback, 480, 180, '', title);  
               
                      
               var ClientCallback = function (arg)   
               
                  //alert('btnName: ' + btnName + ' arg: ' + arg); 
                   if (arg)  
                   
                       __doPostBack("<%= myBtn.UniqueID%>", 'Recover');
                   
               }


Kind regards,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Window
Asked by
Ahmet Ozkan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ahmet Ozkan
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or