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

ILMerge : predefined type defined in multiples assemblies
How to query if a website has SSL certificate?
RegEx to find if a string lies in a range of number strings
How to access and consume C# dlls in Java swings GUI applications
Process a List<Dictionary<int, T>> to a List<List<T>> C# generics [closed]
Possible to temporarily store a file locally before sending to ftp server?
WCF hybrid service
How to organize a HIERARCHY of non-UI threads and get status and progress back for UI consumption
Does the idea of 'Class' in C++/C#/Java come from struct in C? [duplicate]
Custom msmq trace listener
jQuery white label theme widget auto reload
mpi packet for c# paralleling program
The type of name space “” could not be found VS2013
C# Create a Truncated Collection with LINQ [duplicate]
How to get User Control in listbox data template item
Start from scratch MVC [closed]

Categories

HOME
oop
alasql
bigtable
postsharp
okhttp3
symfony-sonata
snmp
grid
sdk
sequence
wavefront
android-webview
annyang
obd-ii
token
jpql
elastalert
urllib2
distinct
camunda
simd
openam
lotusscript
ng-tags-input
my.cnf
oracle10g
drombler-fx
meteor-accounts
folder
foxpro
opencsv
spring-oauth2
contextmenustrip
snapkit
openvms
binary-decision-diagram
amazon-fire-tv
bioperl
selection-sort
esprima
huawei
sqlproj
mac-app-store
xcode7.1
altova
db2-zos
python-rq
pebble-js
treelist
jmap
wizard
dcast
imageicon
redquerybuilder
openhab
polarion
playn
chrome-mobile
jad
teamstudio-unplugged
fiware-health
iphone-6
method-overloading
jsonmodel
report-builder2.0
jsonschema2pojo
triplestore
banana-pi
code-complete
pechkin
angularjs-select2
playing-cards
usersettings
codeigniter-form-helper
setcookie
rfc822
motordriver
openafs
doxia
filedialog
jquery-ui-map
diazo
project-files
umfpack
method-call
object-tag
xhtmlrenderer
jquery-attributes
dongle
xslt-grouping
hp-trim
j++
ironpython-studio

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