0

I am working on an asp.net application where I have a select button and a delete button like this:

' OnClientClick="return confirm('Are you sure you want to delete this record?');" oncommand="lnkDelete_Command">

Where createShippingAddress should show current record in jquery ui dialog. I am able to show jquery ui dialog like this:

 function createShippingAddress() {
            $("#AddShippingPopup").dialog("widget").find(".ui-dialog-titlebar-close").hide();
            $("#AddShippingPopup").dialog("open");
            return false;
        } 

but how to show current record in jquery dialog? Do I need to use web method and call it using jquery Ajax ?

Also, On delete function, I am using confirm box. I want to show jquery ui dialog with ok and cancel buttons and when user clicks Ok, it should delete that record.

I tried this:

 OnClientClick="javascript:return deleteItem('<%# Eval("EmployeeID") %>' );" 

but I am getting error that tag is not well formatted.

How can I pass current record to jquery ui dialog function ?

2
  • Here, jquery Ajax is your friend buddy. Commented Jun 23, 2014 at 10:27
  • @KrunalPatil will it be used for both delete and view ? Commented Jun 23, 2014 at 10:52

1 Answer 1

0

Try Something Like

OnClientClick='<%# "alert(\"" + Eval("Message") + "\");" %>'

OR

<asp:HyperLink id="hklk" runat="server" Text='<%# Eval("Message") %>' onclick="return GiveAlert(this);"></asp:HyperLink>

function GiveAlert(con)
{    
     alert(con.innerHTML);    
     return false;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.