Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-09-29
11
Medium Priority
?
1,266 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 2000 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 2000 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 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