How do I call a C# method in jquery script with passing parameters? I have a jquery accordion with icons implemented dynamically in code behind, once the user clicks the icon it should redirect to a certain page with passing parameter in the url. The data inside the accordion will be populated from the database and what I want to do is for example, when I click on the edit icon, it'd redirect to the editing page with the id of that specific record.
This is how my jQuery accordion looks like:
Accordion code:
<div id="accordion">
<h3>Section 1 <span class="ui-icon ui-icon-lightbulb"></span></h3>
<div>
<p>
Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
</p>
</div>
An example of code when clicking the icon in jquery accordion:
$('span.ui-icon-lightbulb').click(function(e) {
alert('Lightbulb');
e.preventDefault();
e.stopPropagation();
});
It is similar to the following href functionality
<a href='EditRecord.aspx?recordID=" + record.ID + "'>Edit record</a>
but how to do it in jquery by passing the record id from asp.net c# code behind?