ASP.Net with AJAX Textbox question

H

HockeyFan

I'd like to have an AJAX textbox that after the user fills in, will
auto-fill another textbox on the page without having a postback
occur. It doesn't have to do any filtering or any other thing like
that. I'm fairly experienced with ASP.Net, but new to AJAX. Please
help if you can. Thanx.
 
O

OJ

I'd like to have an AJAX textbox that after the user fills in, will
auto-fill another textbox on the page without having a postback
occur. It doesn't have to do any filtering or any other thing like
that. I'm fairly experienced with ASP.Net, but new to AJAX. Please
help if you can. Thanx.

Hi,
if you don't want a postback then don't use AJAX. The effect you are
looking for can be achieved through client Javascript if you want to
avoid a postback. On the other hand, if you are only looking to do a
PARTIAL postback, then use an AJAX updatepanel and the Trigger
functionality....I guess it depends on where the data for the 2nd
textbox is originating...

Hth,
OJ
 
H

HockeyFan

Hi,
if you don't want a postback then don't use AJAX. The effect you are
looking for can be achieved through client Javascript if you want to
avoid a postback. On the other hand, if you are only looking to do a
PARTIAL postback, then use an AJAX updatepanel and the Trigger
functionality....I guess it depends on where the data for the 2nd
textbox is originating...

Hth,
OJ

I thought the whole point of AJAX was client-side javascript. Am I
wrong about that? If so, then what is AJAX really and how does it
different from ASP.Net?
 
O

OJ

I thought the whole point of AJAX was client-side javascript. Am I
wrong about that? If so, then what is AJAX really and how does it
different from ASP.Net?

hi,
yeah...it uses client side scripting to enable partial page postbacks
and partial page rendering. It stands for Asynchronous Java with XML.
If you don't want/need to postback to the server for information for
the second Textbox then you only need the "Java" bit of AJAX. If you
need data from the server you need the Async...with XML" bit!!

Basically, is the info you need for the 2nd textbox originating from
the server? If so, then use the AJAX updatepanel. If the information
is not on the server (for instance, it is calculated based on the
entry in the 1st textbox, then this can be done entirely client side
using Javascript only, hence no postback to the server). I hope this
is a bit clearer..

Regards,
Oliver
 
H

HockeyFan

hi,
yeah...it uses client side scripting to enable partial page postbacks
and partial page rendering. It stands for Asynchronous Java with XML.
If you don't want/need to postback to the server for information for
the second Textbox then you only need the "Java" bit of AJAX. If you
need data from the server you need the Async...with XML" bit!!

Basically, is the info you need for the 2nd textbox originating from
the server? If so, then use the AJAX updatepanel. If the information
is not on the server (for instance, it is calculated based on the
entry in the 1st textbox, then this can be done entirely client side
using Javascript only, hence no postback to the server). I hope this
is a bit clearer..

Regards,
Oliver- Hide quoted text -

- Show quoted text -


Client-side only:
So if I can do it with Javascript, what do I put in my textbox control
to tell it to run the javascript? Is there any OnChange event or what
will I be hoping to invoke the javascript with from inside the
Asp:Textbox control?
 
O

OJ

Client-side only:
So if I can do it with Javascript, what do I put in my textbox control
to tell it to run the javascript? Is there any OnChange event or what
will I be hoping to invoke the javascript with from inside the
Asp:Textbox control?- Hide quoted text -

- Show quoted text -

Hi,
(depending on the client browsers Javascript support) There are
javascript events for all html controls....

have a look here to get you started...

http://www.w3.org/TR/html4/interact/scripts.html

Like I said though, it really depends on what you want in your 2nd
textbox and how you want to get it. Perhaps if you expand on this a
bit more I can give you a more relevant response..


Regards,
OJ
 
H

HockeyFan

Hi,
(depending on the client browsers Javascript support) There are
javascript events for all html controls....

have a look here to get you started...

http://www.w3.org/TR/html4/interact/scripts.html

Like I said though, it really depends on what you want in your 2nd
textbox and how you want to get it. Perhaps if you expand on this a
bit more I can give you a more relevant response..

Regards,
OJ- Hide quoted text -

- Show quoted text -

The user types something in the first textbox. I'd like that copied
to the second, but the user can change the second if they want. One
is a name field. The second is a legal name field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top