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

  • SEARCH
  • Home
  • 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 8628917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:40:22+00:00 2026-06-12T08:40:22+00:00

I am using backbone.js with ASP.NET MVC 4. I want to call methods of

  • 0

I am using backbone.js with ASP.NET MVC 4.

I want to call methods of different view from one of the view. To make this simpler to understand I have created a small example below.

Here in the MyView2 in side the OperationCompleted method I want to call the following…

  • call myMethodB of MyView 2
  • call myMethodA of MyView 1
  • call myMethodC of AppView

How do I do this ? I have temporarily used something like creating objects of view and calling them.

Something like this var view1 = new MyView1(); and then view1.myMethodA();, there has to be a better way, Please help me find it. Thanks

var MyModel = Backbone.Model.extends({
});

// View for a Main Grid
var MyView1 = Backbone.View.extend({
...
myMethodA: function(){
 // do something with View 1
}
...
});


// View for subgrid in Main Grid
var MyView2 = Backbone.View.extend({
...
myMethodB: function(){
 // do something with View 2
},
OperationCompleted: function(){
 // call myMethodB of MyView 2
 // call myMethodA of MyView 1
 // call myMethodC of AppView
}
...
});

var AppView = Backbone.View.extend({
...
myMethodC: function(){
 // do something with App View 
}
...
});
  • 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-06-12T08:40:24+00:00Added an answer on June 12, 2026 at 8:40 am

    Got this working ! had to use the Aggregator pattern, have pasted below a sample example of how I used it…

    Backbone.View.prototype.eventAggregator = _.extend({}, Backbone.Events);
    
    var model = Backbone.Model.extend({
    });
    
    var view1 = Backbone.View.extend({
        initialize: function () {
            this.eventAggregator.bind("doSomething_event", this.doSomething);
        },
        doSomething: function(name){
            alert("Hey " + name + " !");
        }   
    });
    
    var view2 = Backbone.View.extend({    
        callToDoSomething: function(){
            self.eventAggregator.trigger("doSomething_event", "Yasser");
        }   
    });
    

    References

    https://stackoverflow.com/a/11926812/1182982

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok I know this is a long shot. I am using asp.net mvc on
I implemented some code using backbone.js in Asp.NEt MVC3 and found backbone.js very helpful.
In ASP.NET MVC there is Model, View and Controller. MODEL represents entities which are
I'm using backbone.js, underscore.js and jQuery. I took the following sample code from http://jsfiddle.net/thomas/C9wew/6/
Are there any open source asp.net web applications which are using backbone.js and preferably
I'm quickly falling in love with ASP.NET MVC beta, and one of the things
We're using Backbone.js in one of my team's projects, and this is the first
Possible Duplicate: Call methods of different views in Backbone.js I am new to backbone.js
I am using backbone.js here is my scenario Lets say I have a view
I'm using Backbone.Marionette and need to render a view of employees and their respective

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.