c#


How to fill a textbox by using another textbox textchanged event?


I have already asked this question. But I did not get a proper answer thats why I am asking same question in more detail way.
I have a textbox text changed event .That is
protected void txtbox1_TextChanged(object sender, EventArgs e)
{
string str = "select TimeIn from MusterRoll where EmpCode='" + txtbox1.Text + "'";
SqlDataReader dr=conn.query(str);
if(dr.Read())
{
txtbox2.Text=dr[0].ToString();
}
}
My issue is when I enter textbox1(EmpCode) textbox2 is not filling. Its fills only when I click on submit button(fills only page getting refreshed). But I want to fill texbox2 on the spot itself when I enter textbox1 value...eg(if I write this query in a dropdownlist selectedindexchanged event it will work properly. The same way I want work this with this texchanged event). help me
You can use Update Panel or use AJAX to get data and fill the textbox2.
You need to set AutoPostBack property of the textBox1 to true asblow:
textBox1.AutoPostBack = true;

Related Links

SmtpClient.SendAsync() not receiving all messages I sent
OpenFileDialog no show in different AppDomain
Storing Reference to Non-Static Method
What is the best practice for login attempts and locking account accounts in asp.net membership provider
What's the deal with the version number attached the name of the dll?
How would you invoke an event with reflection?
Conditional Compile of Generic Methods
VS WinForm designer always changes custom constructor?
Run C# application from cmd
Knowing the status of a very long function (execution time) in another class [closed]
Add a single row containing text taking up entire area of WPF Datagrid
CGBitmapContext in MonoTouch throws invalid handle exception
Create a list to display the contents of a dictionary?
Get file to FileStream from remote path with another user credentials
Implementing the min & max function with group by and having in linq
JSON or HTML returned from webmethod

Categories

HOME
internet-explorer
process
display
abc
ebay-api
conceptual
hex
salesforce-lightning
esxi
sms
google-docs-api
handlebars.js
virtualhost
doctrine2
velocity
point-of-sale
solidity
virtualenv
chef-recipe
watson-dialog
comma
repeater
hapijs
gomobile
restructuredtext
git-branch
klipfolio
gnu-screen
javaagents
connection-pooling
concatenation
pumping-lemma
orgchart
typeorm
delphi-2010
wordpress-rest-api
kubectl
unity3d-5
favorites
availability
epub
azure-storage-files
matrix-multiplication
queryover
libconfig
observer-pattern
ninja-forms
sknode
directadmin
jks
hierarchical-clustering
jsfl
jcs
overhead
scrollmagic
boost-range
require-handlebars
magick.net
avaudiorecorder
factorization
web-performance
encode
personality-insights
android-networking
veeam
conkeror
applinks
diffmerge
register-allocation
nsurlrequest
xmlserializer
formbuilder
agent-based-modeling
sendy
facebook-java-api
nomachine
code-complete
pechkin
google-checkout
pymel
blotter
vline
gssapi
beep
bash4
rjs
virtual-destructor
versions
newspeak
mysql-pconnect
mdd

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App