Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5998179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:22:08+00:00 2026-05-23T00:22:08+00:00

I have a myPage.cshtml page. i have written a @helper method( myMethod() ) in

  • 0

I have a myPage.cshtml page. i have written a @helper method( myMethod() ) in myHelper.cshtml. I can call the helper method inline in the page ( @myHelper.myMethod(); ) and it works just fine.

How do i call this same method from a user initiated event like ( menu.item.click, button.click, link click ) ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:22:08+00:00Added an answer on May 23, 2026 at 12:22 am

    Because your method executes in server-side code, you’ll have to create a way to call the code on your server from the client. For example, you could have an action method like this:

    [HttpPost]
    public ActionResult MyHelperCaller()
    {
        // Returns the contents of the 'myHelperCaller' view:
        return this.View();
    }
    

    …where the myHelperCaller View contains a call to your myMethod() helper method.

    Then to call that from the client you’d use something like:

    <div id="myHelperTarget"></div>
    <input id="myHelperTrigger" type="button" value="Call MyHelper" />
    <script language="text/javascript">
    
    $("#myHelperTrigger").click(function () {
        // Loads the myHelperCaller view into the myHelperTarget div:
        $("#myHelperTarget").load("/MyController/MyHelperCaller");
    });
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a certain page (we'll call it MyPage) that can be accessed from
Mypage.cshtml have a page and have a domain xxx.com and a subdomain test.xxx.com that
I have a page X.cshtml with the following code: @helper CodeTest{ <h1>Test</h1> } And
I have links like these that I want to change: mypage.com?page=missions&id=5 mypage.com?page=hello I tried
I have the following in a page e.g. /mypage?myvar=oldvalue $_SESSION['myvar'] = $_GET['myvar']; $myvar =
I currently have a page which is declared as follows: public partial class MyPage
Here's the problem: 1.) We have page here... www.blah.com/mypage.html 2.) That page requests a
I have Dropdownlist on my page and its selectedindexchanged method created in code behind
I have a page (mypage.html) which sets a cookie as follows: setcookie (sessionid, md5
I have a web page named MyPage.aspx and two master page named Home.master and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.