473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

TextBox Control

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
6 1717
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

"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
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
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
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

<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mark Johnson | last post by:
The last reply got sort of cutoff. So here again: So for anyone interested, here's the simple regexp patterns for the substitutions required. The textbox control is being 'zoomed' in a popup...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
2
by: Pham Nguyen | last post by:
Has anyone seen an example of a textbox server control that has built-in client-side validation? I'd like to build a server control that extends the System.Web.UI.WebControls.TextBox class to allow...
0
by: Dot net work | last post by:
Hi, Make up a very simple project as follows: 1 aspx form 3 web user controls (referred to as A, B, and C) "A" web user control: Put 1 textbox and 1 button on this web user control. (You...
7
by: I am Sam | last post by:
I have a DataGrid that is passing information to a stored procedure properly but the parameters aren't being casted properly. I was woundering if anyone can tell me how I should properly cast the...
4
by: Samy | last post by:
Hi There, I have a user control with a textbox and a button which when clicked opens a calendar control(calendar.aspx page). When I select a date from the calendar control, the date is supposed to...
11
by: Keith | last post by:
I apologize for those of you who think I'm posting on the same topic. It is not that I don't appreciate all of your comments - and I'm definitely reading them all - but I think I have a differing...
2
by: Mamatha | last post by:
Hi I want to add an icon to the textbox's text. I don't know how to display icon in textbox in VB.NET. If any one knows please let me know. Thanks in advance. Mamatha
6
by: RP | last post by:
I want to clear all the Text Boxes on the Form. Is there any short method to avoid clearing them one by one.
8
by: Marco Pais | last post by:
Hi there. How can I change the background color of a textbox when it gets the focus? I can handle the "Enter" event and do this private void txtDummie_Enter(object sender, EventArgs e) { ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.