[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

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.
0
jbaisden
Asked:
jbaisden
  • 3
  • 3
1 Solution
 
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
 
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jbaisdenAuthor Commented:

Okay is #1 possible?
0
 
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
 
jbaisdenAuthor Commented:

Well, I guess that wraps this up. Thanks for your help.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now