H
HockeyFan
My function to get an alert box on the page isn't working.
Instead it puts in the bottom section of the page:
<script type="text/javascript">
<!--
This is a test// -->
</script>
The function is:
public static void MessageAlert_Create(ref System.Web.UI.Page
thePage,
Type thisType,
string strMessage,
string strKey)
{
System.Web.UI.ClientScriptManager ClientScript =
thePage.ClientScript;
string strScript = "alert('" + strMessage + "');";
if (!ClientScript.IsStartupScriptRegistered(thisType,
strKey))
{
ClientScript.RegisterStartupScript(thisType, strKey,
strMessage, true);
}
}
and I call this function as follows:
System.Web.UI.Page pg = this;
Bus.UtilStatic.MessageAlert_Create(ref pg,
this.GetType(), "This is a test", "Tester");
any ideas how to get the alert box to show up?
Instead it puts in the bottom section of the page:
<script type="text/javascript">
<!--
This is a test// -->
</script>
The function is:
public static void MessageAlert_Create(ref System.Web.UI.Page
thePage,
Type thisType,
string strMessage,
string strKey)
{
System.Web.UI.ClientScriptManager ClientScript =
thePage.ClientScript;
string strScript = "alert('" + strMessage + "');";
if (!ClientScript.IsStartupScriptRegistered(thisType,
strKey))
{
ClientScript.RegisterStartupScript(thisType, strKey,
strMessage, true);
}
}
and I call this function as follows:
System.Web.UI.Page pg = this;
Bus.UtilStatic.MessageAlert_Create(ref pg,
this.GetType(), "This is a test", "Tester");
any ideas how to get the alert box to show up?