Click here to Skip to main content
15,901,505 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I need to get UniqueID while calling the javascript method.

XML
<asp:LinkButton ID="lnkDelete" 
runat="server" Style="cursor: pointer; text-decoration: none;"
OnClientClick="javascript:return confirmMessage(this.UniqueID);" CssClass="buttonfont" Text="Edit" OnClick="lnkDelete_Click">Delete</asp:LinkButton>



C#
function confirmMessage(obj) {
           debugger;
           $("#dialog-confirm").dialog({
               autoOpen: false,
               resizable: false,
               height: 140,
               modal: true,
               buttons: {
                   "Delete": function () {
                       debugger;
                       $(this).dialog("close");
                       __doPostBack('ctl00$ContentPlaceHolder1$JobsRightControl$lnkDelete','');
                       return true;

                   },
                   "Cancel": function () {
                       debugger;
                       $(this).dialog("close");
                   }
               }
           });
           $('#dialog-confirm').dialog('open');
           return false;
       }
Posted
Updated 28-Nov-13 18:32pm
v2

1 solution

Hi,

There is no property call unique ID.

you can use
C#
Control.ClientID
with in server tag

[Update]

__doPostBack(this.ID,'');

You will get unique ID because when page rendered id would be automatically placed uniquely.
 
Share this answer
 
v2
Comments
Rockstar_ 29-Nov-13 0:33am    
Hi Roy,
Please check my updated question..?
Please have a look at __doPostBack() method, I need to get the ID like that..
Rockstar_ 29-Nov-13 0:34am    
I'm going to create a confirmation message box.
Suvabrata Roy 29-Nov-13 0:43am    
Plz refer to Update
Naresh Pansuriya 29-Nov-13 2:26am    
Hi, are you using asp.net data control for same?
Suvabrata Roy 29-Nov-13 2:41am    
I did not got you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900