Currently, my challenge involves inserting a javascript
code into the code behind page of an asp.net
application using c#
.
While browsing through various resources, I stumbled upon some solutions provided by this website. Despite implementing them as instructed, I am still facing difficulty in successfully calling a function from
ScriptManager.RegisterClientScriptBlock()
.
Below is snippet of my code for your reference:
protected void Page_Load(object sender, EventArgs e)
{
string myScriptValue = "function callMe() {alert('You pressed Me!');}";
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myScriptName", myScriptValue, true);
}
I kindly seek assistance on how to properly call the callMe()
function within the Page_Load()
method.