Solved

Correct :  'Public Function IsStartupScriptRegistered(key As String) As Boolean' is obsolete

Posted on 2008-09-29
11
1,235 Views
Last Modified: 2012-05-05
I am working in VB.Net and am getting the following error..can some body help me correcting this...

my code is
If (Not IsStartupScriptRegistered("Startup")) Then
                RegisterStartupScript("Startup", scriptString.ToString)
            End If


BC40000 : 'Public Function IsStartupScriptRegistered(key As String) As Boolean' is obsolete: 'The recommended alternative is ClientScript.IsStartupScriptRegistered(string key). http://go.microsoft.com/fwlink/?linkid=14202' in Reports.aspx.vb(41, 0)

BC40000 : 'Public Overridable Sub RegisterStartupScript(key As String, script As String)' is obsolete: 'The recommended alternative is ClientScript.RegisterStartupScript(Type type, string key, string script). http://go.microsoft.com/fwlink/?linkid=14202' in Reports.aspx.vb(42, 0)

0
Comment
Question by:Kerau
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 13

Expert Comment

by:SameerJagdale
ID: 22596111
the 2 functions are obsolete, however it will not stop you from running the application i guess.
you can change the functions to the recommended one like for IsStartupScriptRegistered("Startup")) use ClientScript.IsStartupScriptRegistered("Startup"))
and same for the second one.
0
 

Author Comment

by:Kerau
ID: 22596180
Thanks Sameer, You are correct it doesn't stop me running the application but need to eliminate the warning as well ...so i tried this

IsStartupScriptRegistered("Startup")) use ClientScript.IsStartupScriptRegistered("Startup")) works fine ..........but  when i use change the second line
RegisterStartupScript("Startup", scriptString.ToString) to ClientScript.RegisterStartupScript("Startup", scriptString.ToString)

I get the following error..
overload resolution failed because no accessible 'RegisterStartupScript' accepts this number of arguments :(
0
 
LVL 13

Expert Comment

by:SameerJagdale
ID: 22596258
try this:
ClientScript.RegisterStartupScript(typeof(string),"Startup", scriptString.ToString)
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

Author Comment

by:Kerau
ID: 22596279
sure thanks..i will use this and get back to u asap..:)
0
 

Author Comment

by:Kerau
ID: 22596305
says 'string' is a class type and can't be use as an expression
0
 
LVL 13

Expert Comment

by:SameerJagdale
ID: 22596359
change the first parameter to:
typeof(Page) and try
0
 

Author Comment

by:Kerau
ID: 22596412
It says type is expected ..suggests me as typeof(Page)Is??????
0
 
LVL 13

Accepted Solution

by:
SameerJagdale earned 500 total points
ID: 22596461
i guess you are using vb.net
try this
ClientScript.RegisterStartupScript(GetType(Page), "Startup",scriptString.ToString)
0
 

Author Comment

by:Kerau
ID: 22596511
I am using VB.net :).

just a quick question...which one would you prefer /conventional way in a vb

Dim urlString As String = ""

OR

Dim urlString  = ""
0
 
LVL 13

Assisted Solution

by:SameerJagdale
SameerJagdale earned 500 total points
ID: 22596526
Dim urlString As String = ""

if you use
Dim urlString  = ""

urlString would be considered as an object not a string.. ultimately string is an object but then it is not strongly typed.
thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question