marlin Posted March 25, 2005 Posted March 25, 2005 I tried to write client-script code in ASP.NET code behind (as shown in bold below) using Visual Studio.NET, but somehow it keeps on telling me that either RegisterClientScriptBlock or IsStartupScriptRegistered are not members of System.Web.UI.Page. Could anyone please help me with this? Thank you. ========================================================== Public Class LaborDistributionDownload Inherits System.Web.UI.Page #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() End Sub Protected WithEvents Form2 As System.Web.UI.HtmlControls.HtmlForm Protected WithEvents btnDownload As System.Web.UI.WebControls.Button Protected WithEvents DIV1 As System.Web.UI.HtmlControls.HtmlGenericControl Protected WithEvents LinkButton1 As System.Web.UI.WebControls.LinkButton Protected WithEvents aDownloadNow As System.Web.UI.HtmlControls.HtmlAnchor 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim strStartupScript As String strStartupScript = "<script language=JavaScript>" strStartupScript = strStartupScript & "aDownloadNow.href='" & Session("strReportFolder") & "/" & Session("strFileName") & "" strStartupScript = strStartupScript & "<" & "/" & "script>" If (Not Page.IsStartupScriptBlockRegistered("scriptSetHref")) Then Page.RegisterStartupScriptBlock("scriptSetHref", strStartupScript) End If End Sub End Class Quote
wessamzeidan Posted March 31, 2005 Posted March 31, 2005 its Page.RegisterStartupScript, not Page.RegisterStartupScriptBlock Quote Proudly a Palestinian Microsoft ASP.NET MVP My Blog: wessamzeidan.net
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.