Kerau
asked on
Correct : 'Public Function IsStartupScriptRegistered(key As String) As Boolean' is obsolete
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("Sta rtup", scriptString.ToString)
End If
BC40000 : 'Public Function IsStartupScriptRegistered( key As String) As Boolean' is obsolete: 'The recommended alternative is ClientScript.IsStartupScri ptRegister ed(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.RegisterStart upScript(T ype type, string key, string script). http://go.microsoft.com/fwlink/?linkid=14202' in Reports.aspx.vb(42, 0)
my code is
If (Not IsStartupScriptRegistered(
RegisterStartupScript("Sta
End If
BC40000 : 'Public Function IsStartupScriptRegistered(
BC40000 : 'Public Overridable Sub RegisterStartupScript(key As String, script As String)' is obsolete: 'The recommended alternative is ClientScript.RegisterStart
ASKER
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.IsStartupScri ptRegister ed("Startu p")) works fine ..........but when i use change the second line
RegisterStartupScript("Sta rtup", scriptString.ToString) to ClientScript.RegisterStart upScript(" Startup", scriptString.ToString)
I get the following error..
overload resolution failed because no accessible 'RegisterStartupScript' accepts this number of arguments :(
IsStartupScriptRegistered(
RegisterStartupScript("Sta
I get the following error..
overload resolution failed because no accessible 'RegisterStartupScript' accepts this number of arguments :(
try this:
ClientScript.RegisterStart upScript(t ypeof(stri ng),"Start up", scriptString.ToString)
ClientScript.RegisterStart
ASKER
sure thanks..i will use this and get back to u asap..:)
ASKER
says 'string' is a class type and can't be use as an expression
change the first parameter to:
typeof(Page) and try
typeof(Page) and try
ASKER
It says type is expected ..suggests me as typeof(Page)Is??????
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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 = ""
just a quick question...which one would you prefer /conventional way in a vb
Dim urlString As String = ""
OR
Dim urlString = ""
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
might just interest you :)
https://www.experts-exchange.com/questions/23791451/Issues-with-Date-Range-Picker.html
https://www.experts-exchange.com/questions/23791451/Issues-with-Date-Range-Picker.html
you can change the functions to the recommended one like for IsStartupScriptRegistered(
and same for the second one.