Hi,
In my page load event i have:-
RegisterClientS cripts();
if (!Page.IsClient ScriptBlockRegi stered("BannerS cript"))
if (!IsPostBack)
{
_userLink.Attri butes.Add("oncl ick", string.Format(" ShowPopupWindow ('UserWindow'); "));
}
My RegisterClientS cripts consists of:-
private void RegisterClientS cripts()
{
string jscriptFunction s = @"<script type='text/javascript'>
<!--
function ShowPopupWindow ( windowName )
{
top.OpenWindowB yName( windowName );
}
//-->
</script>";
// Register the script block
ClientScript.Re gisterClientScr iptBlock(this.G etType(), "BannerScri pt", jscriptFunction s);
}
I have a ASP Hyperlink in the html:-
<asp:HyperLin k 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
In my page load event i have:-
RegisterClientS cripts();
if (!Page.IsClient ScriptBlockRegi stered("BannerS cript"))
if (!IsPostBack)
{
_userLink.Attri butes.Add("oncl ick", string.Format(" ShowPopupWindow ('UserWindow'); "));
}
My RegisterClientS cripts consists of:-
private void RegisterClientS cripts()
{
string jscriptFunction s = @"<script type='text/javascript'>
<!--
function ShowPopupWindow ( windowName )
{
top.OpenWindowB yName( windowName );
}
//-->
</script>";
// Register the script block
ClientScript.Re gisterClientScr iptBlock(this.G etType(), "BannerScri pt", jscriptFunction s);
}
I have a ASP Hyperlink in the html:-
<asp:HyperLin k 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
Comment