Hi,
In my page load event i have:-
RegisterClientScripts();
if (!Page.IsClientScriptBlockRegistered("BannerScript "))
if (!IsPostBack)
{
_userLink.Attributes.Add("onclick", string.Format("ShowPopupWindow('UserWindow');"));
}
My RegisterClientScripts consists of:-
private void RegisterClientScripts()
{
string jscriptFunctions = @"<script type='text/javascript'>
<!--
function ShowPopupWindow( windowName )
{
top.OpenWindowByName( windowName );
}
//-->
</script>";
// Register the script block
ClientScript.RegisterClientScriptBlock(this.GetTyp e(), "BannerScript", jscriptFunctions);
}
I have a ASP Hyperlink in the html:-
<asp:HyperLink ID="_userLink" runat="server" NavigateUrl="#" ImageUrl="~/images/User.gif" ToolTip="User Management" >User</asp:HyperLink>
When I run my program I get a javascript error - Object expected. When I view source the Javascript code doesn't appear.
I know this will be something really simple - but I just cant see it - you know how it is.
Any ideas will be appreciated
Thanks
Janet