Search code examples
c#asp.nethref

Deleting hyperlinks in Asp.Net


I am using Data List and have a column type string (numbers separated by semicolon). On the Item bound side I am separating it with semicolon and adding hyperlink to each those numbers. Now I wanted to provide a functionality where a client can remove the hyperlink and I am not sure how can I achieve it . I have two options:

  1. Providing a button on the client side on the click event of hyperlink, where it says, Open or delete the link and on the server side I delete it from database.

  2. simple cross (x) next to all numbers and on click delete it from database .

Although I don't get how to attach button on the server side to each of those numbers and/or other ways to provide this functionality.

Any help would be highly appreciated.


Solution

  • I found the work around using this : I am using Update panel so I added my code in both $document.ready() as well as : var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest();

    https://forums.asp.net/t/2121543.aspx?How+to+Delete+the+Hyperlink+on+the+Client+Side+