I'm encountering a strange issue with my ASP.NET master page and code behind. Whenever Page.Header.DataBind() is called, all the public methods on my angular service are executed as well.
Below is a snippet of my angular service:
myModule.service("movimientosService", [
function () {
function buscarBase(postData){
alert('why enters here???');
return "";
}
this.buscarMovimientos333 = function(postData){
return buscarBase(postData);
}
}]);
The problem seems to be caused by the following ASP code behind:
protected override void OnLoad(EventArgs e){
base.OnLoad(e);
Page.Header.DataBind();
}
Once Page.Header.DataBind() is triggered, the message box 'why enters here???' pops up. If I comment out Page.Header.DataBind(), the method buscarMovimientos333() is not invoked. Any thoughts on why this is happening?
Interestingly, adding another public method leads to that method being called as well. It appears that each public method gets executed after Page.Header.DataBind().