I have been trying to figure this out for days.
Take this page for example:
The issue appears to be that in order to call the aspx.cs method from a C# function, the aspx.cs method needs to be 'shared' otherwise if we are calling a instance of the class from the C# method it doesn't work. But then on the other hand, Page.ClientScript requires an object reference, so it's not possible to get it to work.
This issue is also explained in this thread:
ClientScript Issue | The ASP.NET Forums
I would be really grateful if someone could show me how to do this.
What I have tried:
All the suggested answers from other threads, which run the code on page load, which is not what I am looking for.
Public Class home
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
pageTitle.Text = "Query Builder v" & System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()
Dim Script As ClientScriptManager = Page.ClientScript
If Not Script.IsClientScriptBlockRegistered(Me.[GetType](), "Alert") Then