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


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.
jbaisdenAsked:
Who is Participating?
 
Carl TawnSystems and Integration DeveloperCommented:
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.
0
 
Carl TawnSystems and Integration DeveloperCommented:
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
0
 
jbaisdenAuthor Commented:


Hmm....its .Net 1.4 framework
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
Carl TawnSystems and Integration DeveloperCommented:
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.
0
 
jbaisdenAuthor Commented:

Okay is #1 possible?
0
 
jbaisdenAuthor Commented:

Well, I guess that wraps this up. Thanks for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.