Javascript communication between ASP.NET web forms and user control


Creation of user control in asp.net is a purpose of code separation and better re-usability. There may be situation where you have to do execute javascript when

main.aspx
userControlEvent = function() {
};

usercontrol.ascx
var userControlEvent;
if ($.isFunction(userControlEvent)) {
                userControlEvent();
 }

Comments