Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3809042
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:14:36+00:00 2026-05-19T15:14:36+00:00

I have the following Sub Routine in my vb.net project which runs fine, but

  • 0

I have the following Sub Routine in my vb.net project which runs fine, but I constantly get build warnings:

‘Public Overridable Sub RegisterClientScriptBlock(key As String, script
As String)’ is obsolete: ‘The recommended alternative is
ClientScript.RegisterClientScriptBlock(Type type, string key, string
script).
visit http://go.microsoft.com/fwlink/?linkid=14202

I think it would be best if I used the correct method. I have followed the instructions here – http://msdn.microsoft.com/en-us/library/system.web.ui.page.registerclientscriptblock.aspx but it didn’t make a great amount of sense. Any help would be appreciated.

Protected Sub DBC_MEMBER_IsActive_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DBC_MEMBER_IsActive.CheckedChanged
        Dim showmessage As String = "Warning!\r\n \r\n Unticking this box will delete this Member from the Databse. \r\n \r\n If you are unsure, make sure the box remains ticked"
        Dim alertScript As String = "<script language=JavaScript> "
        alertScript += "alert('" & showmessage & "');"
        alertScript += "</script" & "> "

        If Not ClientScript.IsClientScriptBlockRegistered("alert") Then
            Me.RegisterClientScriptBlock("alert", alertScript)
        End If
    End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T15:14:37+00:00Added an answer on May 19, 2026 at 3:14 pm

    Try this:

    If Not ClientScript.IsClientScriptBlockRegistered(GetType(YourPageClass), "alert") Then
        ClientScript.RegisterClientScriptBlock(GetType(YourPageClass), "alert", alertScript)
    End If     
    

    (Replace YourPageClass by the name of your page’s class).

    The type and the key parameters are used to prevent registering the same script in the same page. The type parameter probably does not make sense when you register your script directly in the page (like you do). However, it allows for example to avoid potential conflicts between different custom controls which register a script with the same key parameter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: Imports MySql.Data.MySqlClient Imports MySql.Data.Types Public Class FormMain Private Sub
I have the following script which runs once a day on cron on heroku.
I have the following sub-routine. sub Function{ my $ref = \($_[0]); if(ref($ref) eq 'SCALAR'){
i have the following code: Private Sub TxtPStof_KeyPress(ByVal sender As System.Object, ByVal e As
I have the following code: Private Sub SortWorksheet(ByVal sheet As Worksheet) Dim sStartColumn Dim
i have the following code Private Sub select_color_Click(ByVal sender As System.Object, ByVal e As
I basically have the following class: .sf-sub-indicator { background: url(/abcprod/images/arrows-ffffff.png) no-repeat -10px -100px; }
In Excel I have attached a picture to a cell using the following Sub
I have the following program to browse all virtual directories and their sub directories
I have the following code to create my window, my view and my sub

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.