Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I access the codebehind of a formview textbox lostfocus event

Posted on 2010-08-22
7
Medium Priority
?
853 Views
Last Modified: 2012-05-10
Hi

I have a formview control with a textbox.  When the user types a value into the textbox, I need to access a database and retrieve some values, in order to populate other textboxes in the same formview.

Is it possible to write the data access code in the codebehid of the textbox lostfocus event, and then populate the other textboxes?
0
Comment
Question by:C_Newbe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 10

Accepted Solution

by:
Espavo earned 2000 total points
ID: 33495123
Dunno about on TextBox LostFocus...
You could do this, which will trigger does trigger when you esentially loose focus...
Protected Sub SomeTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles SomeTextBox.TextChanged
'Do stuff here...
End Sub
Espavo
0
 

Author Comment

by:C_Newbe
ID: 33495544
Hi

Thanx for the response.  The problem is, that the textchanged event is not fired??  Why would that be?
0
 
LVL 10

Assisted Solution

by:Espavo
Espavo earned 2000 total points
ID: 33495637
Have you set AutoPostback="true"?

<asp:TextBox id="SomeTextBox" runat="server" AutoPostback="true" />
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!

 

Author Comment

by:C_Newbe
ID: 33496257
It is working, sort of.  Just have a problem using the textchanged event, cause if I populate the textbox from a javascript, and ten <tab> off the textbox, the code is not fired.

Any other suggestions?
0
 
LVL 10

Assisted Solution

by:Espavo
Espavo earned 2000 total points
ID: 33496369
You could (could you?) trigger the event when you populate the textbox...
What I'm suggesting is that whatever event is populating the textbox, could also run the code... (No?)
BTW, what could be setting the value of the textbox, other than a user?
0
 

Author Comment

by:C_Newbe
ID: 33499595
Thanx for your replies.  I got it working.  A cardswipe machine is actually setting the value of a textbox.  A clientscript calls a dll to initialise the "pinpad" and then "read" the number into the textbox.
0
 

Author Closing Comment

by:C_Newbe
ID: 33530981
Thanx for all the help
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question