How to call .cs function present using javascript code by not using any button or any onclick event.
Please help me out.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
K P Singh ChundawatRank #1,527 · 1K reputationPosted Jan 10, 2015, 7:06 AM EST
if you are using Asp,net then you can use Webmethod and call it on page load event by using this syntax
Cs Method syntax :- [System.Web.Services.WebMethod]
public static string GetContactName(string custid) { }
jequery syntax $.getJSON('/my/url', function(data) {});
-------------------------------------------------------------------------------------------------------------------
If this is correct answer then please mark it as 'Accepted Answer'
KP Singh