We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

raising events without a postback ??? Is it possible?

jbaisden
jbaisden asked
on
Medium Priority
174 Views
Last Modified: 2010-04-23

Hi experts. Here's the situation. I have created a web user control that contains a series of text boxes among other things (that don't apply to this question). Another web page is using this control. That page might need to do some business rule specific stuff when the focus of a text box in the web control changes. Is it possible to:

1) Fire a method within the control when the focus on the text box changes without making a post back?

2) If #1 can't be done then this can't either....but anyhow.....Could the control raise an event to the containing web page that a text box has lost focus without making a postback?

Any ideas would be appreciated.
Comment
Watch Question

Carl TawnSenior Systems and Integration Developer
CERTIFIED EXPERT

Commented:
If you are working with .Net 2.0 then the new client-side callback mechanism might work for you. You can see an example here:

    http://www.dotnetjunkies.com/Tutorial/E80EC96F-1C32-4855-85AE-9E30EECF13D7.dcik   

And here:

    http://bitarray.co.uk/ben/articles/234.aspx

Author

Commented:


Hmm....its .Net 1.4 framework
Carl TawnSenior Systems and Integration Developer
CERTIFIED EXPERT

Commented:
In that case I don't think its possible. You can switch the AutoPostBack off for the textbox which will simply cache the event until the next postback occurs, but if the event needs to be handled by the server then you have no choice but to postback.

Author

Commented:

Okay is #1 possible?
Senior Systems and Integration Developer
CERTIFIED EXPERT
Commented:
No, because the methods of the web control are only available at the server. What's sent to the browser is just the HTML representation of the control, not any of its methods, so the only way to access them is at the server end.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:

Well, I guess that wraps this up. Thanks for your help.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.