hi all,
in dropdownlist control how to get the results without using Autopostback =true property for ex ,i have binded empid in the dropdown from database ,when selecting the empid from dropdown the corresponding empname should be bind in the textbox from the database ,how this can be done without refreshing the page . i have done this ,but for everytime i selecting the dropdown the page is gets refreshed ,
please help me to solve this issue,
Thanx in advance, kumar
|
| Author: Danasegarane.A 13 Aug 2008 | Member Level: Diamond | Rating: Points: 3 |
May be you have to go for Ajax
May be you could try this example
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/CascadingDropDown/CascadingDropDown.aspx
Thanks and Regards, Danasegarane Arunachalam
|
| Author: Vishal Prajapati 13 Aug 2008 | Member Level: Silver | Rating: Points: 4 |
hi
store empid and empname in dataset and with the use of javascript store empname to textbox.
Syntax that works:
returning a DataSet:
for(var i = 0; i < result.tables[0].rows.length; i++)
alert(result.tables[0].rows[i].col_name);
returning a DataTable:
for(var i = 0; i < result.rows.length; i++)
alert(result.rows[i].col_name);
|
| Author: brijesh 13 Aug 2008 | Member Level: Bronze | Rating: Points: 4 |
hi you can use javascript for this purpose
document.getElementById("ctl00_cphContent_txtHomeUrl").value = document.getElementById('ctl00_cphContent_ddlHomeUrl').value;
by writing a javascript function like this you can bind the employee name in the textbox ,you also have to set DataTextField property of dropdown as empid and DataValueField property as emp name
|
| Author: Geetha 13 Aug 2008 | Member Level: Gold | Rating: Points: 2 |
Hi
in the combobox selected index change event call a javascript function to bind the selected item to the textbox.
Geetha.
|