Hello
How call c# method use javascript in html page
I have method LoadXml("http://localhost/mysite/res/toolbar.xml") and need this method call in html page use javascript.
Example:
How call? Please, help
Loading
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
Amit ChoudharyRank #145 · 15.8K reputationPosted Aug 1, 2011, 12:05 PM EDT
There are various ways to do this. Either you can call this method by a hidden button(Server Control) click event that could be fired any time using javascript code like this:
function clickMyButton() { var ele = document.getElementById('btnHidden'); if ((ele !== null) && (ele != 'undefined')) { ele.click(); } }you can also use PageMethod to achieve this:
See this article Here. nice Explained.
Hope this was helpful.
Mike JonsonRank #7,584 · 238 reputationPosted Aug 1, 2011, 1:09 PM EDT
Mike JonsonRank #7,584 · 238 reputationPosted Aug 2, 2011, 6:03 AM EDT
Windows Form Control:
height="100"; width="300">
I click my button and nothing. O, my God! I cant undestand why. Please help. Thanks
Amit ChoudharyRank #145 · 15.8K reputationPosted Aug 2, 2011, 9:56 PM EDT
If this is the case then Read this article HERE. Will surely help you solving your problem.
Correct me if I'm wrong. Hope this was helpful.
Mike JonsonRank #7,584 · 238 reputationPosted Aug 3, 2011, 1:42 AM EDT