Hi There,
Apologies for this simple and stupid question but I have only just started looking into ASP .NET (been meaning to do it for 3 years and only just found some spare time in between projects !!)
I am trying to develop a small web interface that will allow me to setup / change registry settings for an existing application.
I have one web page with just a textbox and a button on it at the moment. When I click the button I want to place the focus to the textbox, so that I can enter the required configuration data. I am so dumb that I can not even get this to work !!
I am using ASP .NET 1.1 under VS 2003.
In the code behind module for the web page I have the following function defined :-
Private Sub SetFocus(ByVal ctrl As System.Web.UI.Control)
Dim s As String
s = "<SCRIPT language = 'javascript'>document.getElementById('" & ctrl.ID & _
"').focus()</SCRIPT>"
RegisterStartupScript("focus", s)
End Sub
Then in the button click event I call the function setfocus, passing it the name of the ASP textbox control that is one the web form.
However when I run the web site, I get an error saying that the object doesn't support this property or method.
If anyone could please give me any pointers, it would be much appreciated, as I seem to be falling down at the first hurdle on trying to do something so simple!!
Thanks for your help
Apologies for this simple and stupid question but I have only just started looking into ASP .NET (been meaning to do it for 3 years and only just found some spare time in between projects !!)
I am trying to develop a small web interface that will allow me to setup / change registry settings for an existing application.
I have one web page with just a textbox and a button on it at the moment. When I click the button I want to place the focus to the textbox, so that I can enter the required configuration data. I am so dumb that I can not even get this to work !!
I am using ASP .NET 1.1 under VS 2003.
In the code behind module for the web page I have the following function defined :-
Private Sub SetFocus(ByVal ctrl As System.Web.UI.Control)
Dim s As String
s = "<SCRIPT language = 'javascript'>document.getElementById('" & ctrl.ID & _
"').focus()</SCRIPT>"
RegisterStartupScript("focus", s)
End Sub
Then in the button click event I call the function setfocus, passing it the name of the ASP textbox control that is one the web form.
However when I run the web site, I get an error saying that the object doesn't support this property or method.
If anyone could please give me any pointers, it would be much appreciated, as I seem to be falling down at the first hurdle on trying to do something so simple!!
Thanks for your help