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

visual studio 2015 the following error occurred attempting to run the project model server process(1.0.3)
Stored procedure OUTPUT VARCHAR2 value truncated using 12c client
LINQ to Entities does not recognize the method 'System.String ToString(System.String)
How to get from a hashset all the elements that are of a particular subclass in c#?
enforce the DirectShow to select my video device via lan
Why are settings.settings variables not updating when I assign to them?
C# Chart crashes if there is a big Y-value
Backup localDB database in ClickOnce
how to populate text boxes based on dropdownlist selection mvc
Printing listview using loop prints all rows on the same line C#
Overcoming lack of app.config in SSIS Script Task to resolve memory exception issues
Popup still shows when not minimized
Convert string to int, check total sum of int based on foreach loop
Resizing images in parallel causing out of memory exception
Keep receiving error code CS0165
Dictionary throwing StackOverflowException after ContainsKey for an object is called

Categories

HOME
mobile
gsm
liquibase
livecharts
x509certificate
coordinates
terminal
css-selectors
sequence
subprocess
google-search-appliance
urllib2
mongodb-replica-set
mbed
openscad
template10
openam
airbnb
sonarlint
ampscript
android-wifi
lotusscript
prepros
v4l2
inspec
dynamics-ax-2012-r3
sphinx4
jbossfuse
ios9
openoffice-impress
overflow
jmsserializerbundle
exacttarget
kubectl
qt-designer
availability
flickr
sampling
outlook-2010
scip
pygraphviz
mediastream
ng-lightning
fisheye
susy
file-descriptor
aura-framework
bzip2
definition
test-kitchen
cakephp-3.2
api-key
synchronized
infovis
geminabox
dna-sequence
business-catalyst
nsalert
printer-control-language
msiexec
addressbook
gevent
settext
xcode7.1
jira-agile
mrunit
trendline
overlapping
android-contentresolver
magnet-uri
producer-consumer
event-tracking
properties-file
playn
pdcurses
genero
autopep8
firebase-tools
zoneminder
fscanf
visual-studio-setup-proje
fastcgi-mono-server
grunt-contrib-imagemin
kendo-window
ia-32
nsnumber
violation
azure-pack
google-checkout
rfc822
wpml
nserror
animationdrawable
win-prolog
joomla1.7
mscorlib
hs-err
code-golf
dynamic-scope
calendarextender
authkit
content-delivery-network
expander
cons

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