473,606 Members | 3,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SetFocus convert from 2003 to 2005 problem

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.C ontrol)
Dim s As String = "<SCRIPT
language='javas cript'>document .getElementById ('" & ctrl.ID &
"').focus() </SCRIPT>"
RegisterStartup Script("focus", s)
End Sub
This is how it is called:
Me.SetFocus(con trolName)

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 RegisterStartup Script(key As String,
script As String)' is obsolete: 'The recommended alternative is
ClientScript.Re gisterStartupSc ript(Type type, string key, string
script). http://go.microsoft.co m/fwlink/?linkid=14202'

With warning 2 I tried the suggested alternative but then it complains
about incorrect number of arguments??

Help! - Thanks

Nov 13 '06 #1
2 2983
vs2005 has this feature builtin. use the builtin or change the name of your
routine.

-- bruce (sqlwork.com)

<gn******@gmail .comwrote in message
news:11******** ************@h5 4g2000cwb.googl egroups.com...
>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.C ontrol)
Dim s As String = "<SCRIPT
language='javas cript'>document .getElementById ('" & ctrl.ID &
"').focus() </SCRIPT>"
RegisterStartup Script("focus", s)
End Sub
This is how it is called:
Me.SetFocus(con trolName)

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 RegisterStartup Script(key As String,
script As String)' is obsolete: 'The recommended alternative is
ClientScript.Re gisterStartupSc ript(Type type, string key, string
script). http://go.microsoft.co m/fwlink/?linkid=14202'

With warning 2 I tried the suggested alternative but then it complains
about incorrect number of arguments??

Help! - Thanks

Nov 13 '06 #2
Thanks for taking the time to respond, I changed the name of the
function as suggested and that did the trick.
bruce barker (sqlwork.com) wrote:
vs2005 has this feature builtin. use the builtin or change the name of your
routine.

-- bruce (sqlwork.com)

<gn******@gmail .comwrote in message
news:11******** ************@h5 4g2000cwb.googl egroups.com...
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.C ontrol)
Dim s As String = "<SCRIPT
language='javas cript'>document .getElementById ('" & ctrl.ID &
"').focus() </SCRIPT>"
RegisterStartup Script("focus", s)
End Sub
This is how it is called:
Me.SetFocus(con trolName)

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 RegisterStartup Script(key As String,
script As String)' is obsolete: 'The recommended alternative is
ClientScript.Re gisterStartupSc ript(Type type, string key, string
script). http://go.microsoft.co m/fwlink/?linkid=14202'

With warning 2 I tried the suggested alternative but then it complains
about incorrect number of arguments??

Help! - Thanks
Nov 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9674
by: Mad Scientist Jr | last post by:
i am trying to set focus to a specific control depending on the outcome of a validator control and it is not working. none of these methods are working to setfocus: 1. RegisterStartupScript("sf","<scriptlanguage='javascript'>document.form.MyControlID.focus();</script>"); 2. Andy Smith's FirstFocus control from http://www.metabuilders.com/tools/FirstFocus.aspx
3
7708
by: PeterK | last post by:
I am trying to set Public overridable CreditlimitS() as System.Data.SqlTypes.SqlMoney to Creditlimit as Double like CreditLimitS=creditlimit and get this error "Value of type double cannot be converted to System.Data.SqlTypes.SqlMoney " How do I get creditlimit into creditlimitS? There seems to be no conversion function. TIA
8
4015
by: Stephen | last post by:
Hi, has anyone converted code from VS 2005 to VS 2003? Thanks, Stephen
2
2663
by: Chris Davoli | last post by:
I have written a web site (with other class projects) in VS.net 2003 (VB.Net). What does it take to convert to Visual Studio.Net 2005? Can the 2003 project just be opened up in 2005? Will that convert it. The interface for 2005 very different from 2003. -- Chris Davoli
0
1536
by: srinivasarao yarru | last post by:
hi sir, in access 2003 how we can use the setfocuse property(we have to lostfocuse from one field with in that we have to setfocuse in same field) i am using this code but not setfocuse to same field :- Description about this code:- Sex field is one combo box in two options male-1;female-2 IND_APPL is one combo box here options are applicable-1;not applicable-0 CODE:-
3
3468
by: srinivasarao yarru | last post by:
hi in access 2003 how we can use the setfocuse property(we have to lostfocuse from one field with in that we have to setfocuse in same field) i am using this code but not setfocuse to same field (this is my problem please give proper gidence for this problem) :- Description about this code:- Sex field is one combo box in two options male-1;female-2 IND_APPL is one combo box here options are applicable-1;not applicable-0
7
3813
by: Rick | last post by:
I have a web service that I converted from VS 2003 Framework 1.1. to VS 2005 Framework 2.0. I tried to use the same IIS web site to run the web service. I deleted the Framework 1.1 files published the 2.0 files changed IIS to use Framework 2.0 and changed the application pool, also restarted IIS. When I try to get to the web service it tells me the file cannot be found. The web service file(asmx) is in the same place and named the same. The...
2
2328
by: trondhuso | last post by:
Hi group, I've found some code that I want to use in a project that I am working on, but the code is for c# .net and not 2003 or 2005 that I have available. In this code the program yells on (float)Convert.ToDouble(xml.value) (which in this case is "8.25"). I am wondering if someone could tell me how the command is changed in 2003 or 2005 as it stops here.
1
1597
by: lds | last post by:
I have Visual Studio 2005 Professional Edition installed with Service Pack 1. I have several solutions and projects that I have migrated from Visual Studio 2003 to 2005. In most cases the changes I had to make were small and when the web projects were converted it told me to select convert to web application, which I have done. This one application that I have migrated asks me to convert to a "web site project" every time I open the...
0
8036
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8461
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8448
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8317
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6796
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3948
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2454
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1572
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.