Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
XML
<div class="col-md-3">
<p style="font-size:15px;">SHOP ALL </p>

<p class="para_style"> <a href=""> Customers Designs </a> </p>
<p class="para_style"> <a href=""> HOB Designs </a> </p>
<p class="para_style"> <a href=""> ALL Designs </a> </p>
<br/>

<p style="font-size:15px;">SHOP BY STYLE </p>
<p class="para_style"> <a href="">V Neck </a> </p>
<p class="para_style"> <a href=""> U Neck </a> </p>
<p class="para_style"> <a href=""> Square Neck </a> </p>
<p class="para_style"> <a href=""> Sweet Heart </a> </p>
<p class="para_style"> <a href=""> Boat Neck </a> </p>
<p class="para_style"> <a href=""> Hi-Neck </a> </p>
<p class="para_style"> <a href=""> Chinese Collar </a> </p>
<p class="para_style"> <a href=""> Spaghetti </a> </p>
<p class="para_style"> <a href=""> Crop Top</a> </p>
<p class="para_style"> <a href=""> Halter </a> </p>
<p class="para_style"> <a href=""> Sheer Yoke </a> </p>

</div>



I want to send uneck,vneck.... values as a parameter to webmethode.
so how to get it's value from anchor tag in jquery? and send it to webmethode?
Posted
Comments
jaket-cp 23-Sep-15 4:08am    
What have you tried so far?
If you have not tried anything yet, then please have a read of
http://api.jquery.com/jquery.ajax/

Any issues with that implementation, then update your question and I am sure you will get help.

1 solution

Please go through this article here:

Calling ASP.Net WebMethods using jQuery[^]

You can change webmethod from

JavaScript
$.webMethod({
    'methodName': 'GetDate',
    'parameters': {
        'client': 3
    },
    success: function (value) {
        alert(value);
    }
});


to

JavaScript
$.webMethod({
    'methodName': 'GetDate',
    'parameters': {
        'client': $.trim($(this).text())  // get the clicked anchor text here
    },
    success: function (value) {
        alert(value);
    }
});
 
Share this answer
 

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