How to have the ScriptManager in a Utility class

Viewed 22

I'm working on ASP.NET Webform app. Framework 4.6.

I do use ScriptManager extensively across all of my pages to show messages to end user(using JavaScript alert function).

But this is repeated code. In my app(Web application) I created a utility class(inside)Utility.CS. I'm trying to make a static ShowMessage Method inside this class to be able to call it from everywhere. The issue I'm having is ScriptManager does not seem to be accessible inside a class file. It is accessible in any web page,

I tried to extend the class to use webForm but no luck.

There should be solution for this problem.

0 Answers
Related