• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

ASP.NET ajax to change LinkButton dynamically

Can the LinkButton or the like in ASP.NET dynamically change onClick event with Ajax? and at the same time, on the server side, it should updates the value of certain record in the database.
How do I achieve this?
Thanks,
0
luisr69
Asked:
luisr69
  • 2
  • 2
1 Solution
 
edemcsCommented:
Can you provide an example?
0
 
luisr69Author Commented:
I need an example if possible.
0
 
leakim971PluritechnicianCommented:
Yes, you can capture the click on a LinkButton or any other controls
For example with jQuery (where LinkButton1 is the ID of your control) :

$("<%= LinkButton1.CliendID %>").click(function(e) {
    e.preventDefault();
    // code to update value in the database with Ajax (PageMethods for example)
});

An article about PageMethods :
http://www.dotnetcurry.com/ShowArticle.aspx?ID=109
jQuery and asp.net :
http://dotnetslackers.com/articles/ajax/Using-jQuery-with-ASP-NET.aspx
0
 
luisr69Author Commented:
It got me started, Thanks
0
 
leakim971PluritechnicianCommented:
You're welcome! Thanks for the points! Have a nice week-end!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now