I have an AJAX modalpopup which I would like to launch when a page loads. Currently, I have the following in my Page_Load:
HtmlGenericControl myBody = (HtmlGenericControl)Master.FindControl("thebody");
myBody.Attributes.Add("onload", "openMP();")
This successfully injects the onload function (I can tell by looking at the source). However, the onload function never seems to fire. Any advice would be helpful. Thanks.
* Changes following question *
Relevant code in master page:
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
<a href="logout.aspx">
Relevant code in child page:
if (!Page.IsPostBack)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", "openMP();", true);
Response.Write("Test");
}