Re: SetFocus convert from 2003 to 2005 problem
- From: "bruce barker \(sqlwork.com\)" <b_r_u_c_e_removeunderscores@xxxxxxxxxxx>
- Date: Mon, 13 Nov 2006 10:08:34 -0800
vs2005 has this feature builtin. use the builtin or change the name of your
routine.
-- bruce (sqlwork.com)
<gnewsham@xxxxxxxxx> wrote in message
news:1163438464.522400.4320@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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
.
- Follow-Ups:
- Re: SetFocus convert from 2003 to 2005 problem
- From: Problematic coder
- Re: SetFocus convert from 2003 to 2005 problem
- References:
- SetFocus convert from 2003 to 2005 problem
- From: gnewsham
- SetFocus convert from 2003 to 2005 problem
- Prev by Date: Re: running a .net web app on a vax machine
- Next by Date: AJAX control in Master pages
- Previous by thread: SetFocus convert from 2003 to 2005 problem
- Next by thread: Re: SetFocus convert from 2003 to 2005 problem
- Index(es):
Relevant Pages
|