G
gnewsham
I am converting an application from vb.net 2003 to 2005
I have the following function which I call when an input error is
detected:
Private Sub SetFocus(ByVal ctrl As System.Web.UI.Control)
Dim s As String = "<SCRIPT
language='javascript'>document.getElementById('" & ctrl.ID &
"').focus() </SCRIPT>"
RegisterStartupScript("focus", s)
End Sub
This is how it is called:
Me.SetFocus(controlName)
I am getting the following warnings and am unsure how to correct them:
Warning 1 sub 'SetFocus' shadows an overloadable member declared in the
base class 'Page'. If you want to overload the base method, this
method must be declared 'Overloads'.
Warning 2 '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'
With warning 2 I tried the suggested alternative but then it complains
about incorrect number of arguments??
Help! - Thanks
I have the following function which I call when an input error is
detected:
Private Sub SetFocus(ByVal ctrl As System.Web.UI.Control)
Dim s As String = "<SCRIPT
language='javascript'>document.getElementById('" & ctrl.ID &
"').focus() </SCRIPT>"
RegisterStartupScript("focus", s)
End Sub
This is how it is called:
Me.SetFocus(controlName)
I am getting the following warnings and am unsure how to correct them:
Warning 1 sub 'SetFocus' shadows an overloadable member declared in the
base class 'Page'. If you want to overload the base method, this
method must be declared 'Overloads'.
Warning 2 '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'
With warning 2 I tried the suggested alternative but then it complains
about incorrect number of arguments??
Help! - Thanks