By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,054 Members | 902 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,054 IT Pros & Developers. It's quick & easy.

TextBox Control

P: n/a
In looking at the asp.net TextBox, I noticed that there is a property called
"OnTextChanged". I tried to use this control to call a subroutine called
"GetCompanyProperties". The field is the account number. When a user
enters an account number and then tabs or points to another field, I want
the subroutine called so that it can access the database and get the data
fill out six other fields. Nothing happens when I enter the account number
and tab to another text box.

In researching this, I found that I had to set the AutoPostBack property to
true. Still nothing happened. Further reading said that "The ability of a
TextBox control to post automatically to the server when it's text is
changed requires that the browser support ECMAScript and that scripting is
enabled on the user's browser."

I am running Internet Explorer 7. How do I determine if (a) ECMAScript is
supported and (b) if scripting is enabled?
Sep 17 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
It is in your browser's security settings: Tools-Internet Options-Security.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Shelly" <sh************@asap-consult.comwrote in message
news:13*************@corp.supernews.com...
In looking at the asp.net TextBox, I noticed that there is a property
called "OnTextChanged". I tried to use this control to call a subroutine
called "GetCompanyProperties". The field is the account number. When a
user enters an account number and then tabs or points to another field, I
want the subroutine called so that it can access the database and get the
data fill out six other fields. Nothing happens when I enter the account
number and tab to another text box.

In researching this, I found that I had to set the AutoPostBack property
to true. Still nothing happened. Further reading said that "The ability
of a TextBox control to post automatically to the server when it's text is
changed requires that the browser support ECMAScript and that scripting is
enabled on the user's browser."

I am running Internet Explorer 7. How do I determine if (a) ECMAScript
is supported and (b) if scripting is enabled?

Sep 17 '07 #2

P: n/a

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:uN****************@TK2MSFTNGP03.phx.gbl...
It is in your browser's security settings: Tools-Internet
Options-Security.
Before I posted the last time, I looked there. I couldn't find it. That
was why I posted. I also looked in the Advanced tab. Maybe it is there
under another name. In any event, for the intranet (local machine), just
about everything is enabled.
>
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Shelly" <sh************@asap-consult.comwrote in message
news:13*************@corp.supernews.com...
>In looking at the asp.net TextBox, I noticed that there is a property
called "OnTextChanged". I tried to use this control to call a subroutine
called "GetCompanyProperties". The field is the account number. When a
user enters an account number and then tabs or points to another field, I
want the subroutine called so that it can access the database and get the
data fill out six other fields. Nothing happens when I enter the account
number and tab to another text box.

In researching this, I found that I had to set the AutoPostBack property
to true. Still nothing happened. Further reading said that "The ability
of a TextBox control to post automatically to the server when it's text
is changed requires that the browser support ECMAScript and that
scripting is enabled on the user's browser."

I am running Internet Explorer 7. How do I determine if (a) ECMAScript
is supported and (b) if scripting is enabled?


Sep 17 '07 #3

P: n/a
ed
Hi Shelly,

ECMA script just means "JavaScript". IE has supported it since way
back, something like version 2 or 3. It's still there in 7 and not
going anywhere :)

To find out if script is enabled: It nearly always is. I'm not even
sure if there's an IE setting for disabling script any more -- in my
IE6 the security settings are all about what script can do, not if
it's enabled or not.

So your answer probably lies elsewhere.

In general, looking up values in the middle of a web form can get
complicated. It's doable but hard to write and harder still to
maintain (an opinion of course, not a fact). You might want to
consider changing the design so you can avoid it too. I think you'll
find that the easiest approach is:

Page A. Prompt for the account number, and if it's valid go to page B.
Page B. Display account properties; show a "Select another account"
button that will go back to page A.

That's also more common; more or less how Amazon, eBay, Google, etc
implement lookups.

Hope this helps,
- Ed
On Sep 17, 12:36 pm, "Shelly" <sheldonlg.n...@asap-consult.comwrote:
In looking at the asp.net TextBox, I noticed that there is a property called
"OnTextChanged". I tried to use this control to call a subroutine called
"GetCompanyProperties". The field is the account number. When a user
enters an account number and then tabs or points to another field, I want
the subroutine called so that it can access the database and get the data
fill out six other fields. Nothing happens when I enter the account number
and tab to another text box.

In researching this, I found that I had to set the AutoPostBack property to
true. Still nothing happened. Further reading said that "The ability of a
TextBox control to post automatically to the server when it's text is
changed requires that the browser support ECMAScript and that scripting is
enabled on the user's browser."

I am running Internet Explorer 7. How do I determine if (a) ECMAScript is
supported and (b) if scripting is enabled?

Sep 17 '07 #4

P: n/a
ed
Just saw your second post that you're doing an Intranet app. Never
mind - you can get away with the auto postback more easily there,
though I still think it's a little harder to code.

I doubt it's a scripting enabled/disabled problem. Try this: in design
mode, bring up the properties window for your textbox and check the
events. Is the TextChanged event mapped? If not, enter a method name
(anything will do). VS.NET will create a new event handler method
using the name you entered. You can call your GetCompanyProperties
method from there.

Hope I'm barking up the right tree here. Good luck.

- Ed

On Sep 17, 1:23 pm, e...@lakenine.com wrote:
Hi Shelly,

ECMA script just means "JavaScript". IE has supported it since way
back, something like version 2 or 3. It's still there in 7 and not
going anywhere :)

To find out if script is enabled: It nearly always is. I'm not even
sure if there's an IE setting for disabling script any more -- in my
IE6 the security settings are all about what script can do, not if
it's enabled or not.

So your answer probably lies elsewhere.

In general, looking up values in the middle of a web form can get
complicated. It's doable but hard to write and harder still to
maintain (an opinion of course, not a fact). You might want to
consider changing the design so you can avoid it too. I think you'll
find that the easiest approach is:

Page A. Prompt for the account number, and if it's valid go to page B.
Page B. Display account properties; show a "Select another account"
button that will go back to page A.

That's also more common; more or less how Amazon, eBay, Google, etc
implement lookups.

Hope this helps,
- Ed

On Sep 17, 12:36 pm, "Shelly" <sheldonlg.n...@asap-consult.comwrote:
In looking at the asp.net TextBox, I noticed that there is a property called
"OnTextChanged". I tried to use this control to call a subroutine called
"GetCompanyProperties". The field is the account number. When a user
enters an account number and then tabs or points to another field, I want
the subroutine called so that it can access the database and get the data
fill out six other fields. Nothing happens when I enter the account number
and tab to another text box.
In researching this, I found that I had to set the AutoPostBack property to
true. Still nothing happened. Further reading said that "The ability of a
TextBox control to post automatically to the server when it's text is
changed requires that the browser support ECMAScript and that scripting is
enabled on the user's browser."
I am running Internet Explorer 7. How do I determine if (a) ECMAScript is
supported and (b) if scripting is enabled?- Hide quoted text -

- Show quoted text -

Sep 17 '07 #5

P: n/a
Thanks Ed. I know I can change the design. What I can do is not display
the information and only have the account number to enter. The rest of the
fields are only there for cosmetic purposes and are, in fact, readonly. In
the real world, that is what I would do. However, this is for my learning
purposes only and I wanted to see if there was a way. When I wrote this
application for the customer it was on a Linux system and was in php. I
used your A, B approach there. I am rewriting it on my local machine in
asp.net/vb.net purely as a learning tool. I have found in the past that the
hardest part of learning something new is to come up with meaningful
exercises. This one has been great so far.

P.S. Thanks to all of you that have helped me in my learning (asn
especially Mark).

Shelly
<ed@lakenine.comwrote in message
news:11**********************@19g2000hsx.googlegro ups.com...
Hi Shelly,

ECMA script just means "JavaScript". IE has supported it since way
back, something like version 2 or 3. It's still there in 7 and not
going anywhere :)

To find out if script is enabled: It nearly always is. I'm not even
sure if there's an IE setting for disabling script any more -- in my
IE6 the security settings are all about what script can do, not if
it's enabled or not.

So your answer probably lies elsewhere.

In general, looking up values in the middle of a web form can get
complicated. It's doable but hard to write and harder still to
maintain (an opinion of course, not a fact). You might want to
consider changing the design so you can avoid it too. I think you'll
find that the easiest approach is:

Page A. Prompt for the account number, and if it's valid go to page B.
Page B. Display account properties; show a "Select another account"
button that will go back to page A.

That's also more common; more or less how Amazon, eBay, Google, etc
implement lookups.

Hope this helps,
- Ed
On Sep 17, 12:36 pm, "Shelly" <sheldonlg.n...@asap-consult.comwrote:
>In looking at the asp.net TextBox, I noticed that there is a property
called
"OnTextChanged". I tried to use this control to call a subroutine called
"GetCompanyProperties". The field is the account number. When a user
enters an account number and then tabs or points to another field, I want
the subroutine called so that it can access the database and get the data
fill out six other fields. Nothing happens when I enter the account
number
and tab to another text box.

In researching this, I found that I had to set the AutoPostBack property
to
true. Still nothing happened. Further reading said that "The ability of
a
TextBox control to post automatically to the server when it's text is
changed requires that the browser support ECMAScript and that scripting
is
enabled on the user's browser."

I am running Internet Explorer 7. How do I determine if (a) ECMAScript
is
supported and (b) if scripting is enabled?


Sep 17 '07 #6

P: n/a

<ed@lakenine.comwrote in message
news:11*********************@57g2000hsv.googlegrou ps.com...
Just saw your second post that you're doing an Intranet app. Never
mind - you can get away with the auto postback more easily there,
though I still think it's a little harder to code.

I doubt it's a scripting enabled/disabled problem. Try this: in design
mode, bring up the properties window for your textbox and check the
events. Is the TextChanged event mapped? If not, enter a method name
(anything will do). VS.NET will create a new event handler method
using the name you entered. You can call your GetCompanyProperties
method from there.

Hope I'm barking up the right tree here. Good luck.

- Ed
I tried what you said. Nothing happened, so I went into the debugger,
setting a breakpoint in the subroutine. What happened was and information
window telling me:

"Microsoft JScript runtime error: Object doesn't support this property or
method."

The Javacript is the one for __doPostBack that is created when you create a
master page.

The VB subroutine is:

Protected Syb GetCompanyInfo(ByVal sender as Object, ByVal e as
System.EventArgs) Handles account.Number.TextChanged

I have all the processing in this subroutine and the breakpoint is in there.
It never hits the breakpoint because of the Javascript error.

In the aspx file for accountNumber I have OnTextChanged="GetCompanyInfo" and
AutoPostBack="True"

Shelly
Sep 17 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.