D
Dune88
I've got some code that uses Page.ClientScript.RegisterStartupScript to call
a javascript function from the Page_Load method in the code behind.
The code works fine in IE but the javascript function is not called at all
in Firefox. I stripped my code back to the basics and all I have now is a
webform with no controls on it and the following in the code behind:
protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScript(typeof(Page),
"TestScript", "<script type='text/jscript'>alert('test script');</script>");
}
This very basic webform works in IE but not in Firefox.
I'm running .NET Framework 3.5, IE 7 and Firefox 2.0.0.11. I added
"onload="alert('onLoad')"" to the body tag to ensure that javascript was
enabled and popups were not being blocked in Firefox. The onLoad alert came
up fine but the alert added by the RegisterStartupScript did not come up.
Can anyone shed any light on this?
Cheers
a javascript function from the Page_Load method in the code behind.
The code works fine in IE but the javascript function is not called at all
in Firefox. I stripped my code back to the basics and all I have now is a
webform with no controls on it and the following in the code behind:
protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScript(typeof(Page),
"TestScript", "<script type='text/jscript'>alert('test script');</script>");
}
This very basic webform works in IE but not in Firefox.
I'm running .NET Framework 3.5, IE 7 and Firefox 2.0.0.11. I added
"onload="alert('onLoad')"" to the body tag to ensure that javascript was
enabled and popups were not being blocked in Firefox. The onLoad alert came
up fine but the alert added by the RegisterStartupScript did not come up.
Can anyone shed any light on this?
Cheers